Swing Section Index | Page 2
Ask the SystemTray class with its static isSupported() method. The javadoc for the class includes a warning when true is returned. Just because the system tray is supported, doesn't mean all funct...more
The TrayIcon.MessageType enumeration allows you to specify an ERROR, INFO, or WARNING icon, in addition to NONE when displaying a message with displayMessage(). You cannot specify a custom icon.more
If you don't want to size the icon yourself, you can call setImageAutoSize() with a value of true for the TrayIcon. By default, the property is false. When true, the icon will be automatically res...more
How do I clear the selection in a ButtonGroup such that no elements of the associated set of abstract buttons are selected?
Early versions required a hack with a hidden button. In Java 6, you can use the new clearSelection() method.
The importData() method of your TransferHandler has a TransferSupport argument. From this support object, you can ask for the drop location with getDropLocation(). This returns an implementation o...more
When having a droppable JTree, how do I change the default behavior of using selection to see the active drop target?
JTree has a setDropMode() method to change the default setting of USE_SELECTION. Other valid modes are ON, INSERT, and ON_OR_INSERT. ON lets you drop something onto another node. INSERT is for bet...more
You need to explicitly pass in the button labels and initial value via the showOptionDialog() method (or constructor). int selection = JOptionPane.showOptionDialog(CreditDefaultLegPanel.this, ...more
Class AccessibleRole Added the following constants: DATE_EDITOR FONT_CHOOSER GROUP_BOX SPIN_BOX STATUS_BAR
The javax.accessibility.screen_magnifier_present property is available. When true, the magnifier is present, and your application can be altered accordingly.
The 1.4 API increased the accessibility API by adding the following: javax.accessibility.AccessibleEditableText javax.accessibility.AccessibleExtendedComponent javax.accessibility.AccessibleExt...more
The original accessible API set missed some features in the AccessibleComponent interface. Since the main interface couldn't be altered, Sun introduced a secondary interface AccessibleExtendedComp...more
While the Java Access Bridge (http://java.sun.com/products/accessbridge/) exposes the Swing components to the platform, it seems not all screen readers understand this bridge. You can't just use a...more
Chet Haase at Sun claims "Java on Vista: Yes, it Works" at http://weblogs.java.net/blog/chet/archive/2006/10/java_on_vista_y.html. There is more said there than can be written here.more
How can I print the contents of a JTable as a report with title, date/time etc. as a formatted report on a paper?
Apart from the accept all filter, until Java 6, there were no predefined filters. Java 6 introduces the FileNameExtensionFilter, allowing you to define one or more types of files for the user to s...more