The Source for Java Technology Collaboration
User: Password:



Joerg Plewe's Blog

September 2005 Archives


L&F getting active! Substantially!

Posted by herkules on September 16, 2005 at 07:46 AM | Permalink | Comments (2)

Surprise, surprise! L&Fs today don't just look nice. Some add new features to the GUI:

When I started the daily build of NetBeans with my preferred configuration I noticed a small new button in the menubar. I tried it out. It allows to find and activate any menu item that contains a certain text. For each menuitem a small button with a descriptive tooltip is added. Pushing it drops down the resp. menu. How cool! These NetBeans guys .... ts ts ts.... :)





A moment later I figured out that not NetBeans was doing the magic ... jEdit suddenly had the same feature.

In fact, the Substance L&F is responsible for that new feature. IMHO thats new: a L&F not only dealing with the L&F but also adding extended GUI features.
I'm really keen to see what's coming next, go ahead kirillcool!

Quick tabbedpane switching w/o sacrifying mnemonics

Posted by herkules on September 08, 2005 at 03:51 AM | Permalink | Comments (6)

Having JTabbedPanes with many tabs can be awkward concerning keyboard usage. Per-tab mnemonics are not really an option because they really limit the number of available mnemonics for the tabs own valuable content!

Facing this problem, I created the TabSwitcher utility applicable to any JTabbedPane:
new TabSwitcher(tabbedpane, KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.ALT_DOWN_MASK));
TabSwitcher will automatically pop up when the given KeyStroke occurs on the JTabbedPane. It reflects the current number of tabs with their resp. titles and icons, computes a reasonable set of mnemonics and offers them as a JPopupMenu right at the position of the currently selected tab.

For the usage is mnemonic-like, I suggest to use an ALT-combination for the KeyStroke (Alt-T in my sample above).

screenshot


Find the sourcecode here and a usage sample here.



Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds