Swing Section Index
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
The TrayIcon class offers a setToolTip() method to provide a string for the message.
The displayMessage() method of TrayIcon allows you to show a timed message, if supported on the platform.
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
When you create the TrayIcon for the SystemTray, you specify the PopupMenu. TrayIcon trayIcon = new TrayIcon(anImage, "Tooltip", aPopupMenu); Just don't forget to fill it with MenuItem objects. more
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
If I want to manually size my icon for the system tray, how do I find out the correct size for the platform?
The getTrayIconSize() method of SystemTray will return the appropriate Dimension for the icon. This allows you to either pick the most appropriate size from available icons or generate an icon of ...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
The javax.accessibility.screen_magnifier_present property is available. When true, the magnifier is present, and your application can be altered accordingly.
Class AccessibleRole Added the following constants: DATE_EDITOR FONT_CHOOSER GROUP_BOX SPIN_BOX STATUS_BAR
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