Java Tips Weblog

  • Blog Stats

    • 1,952,018 hits
  • Categories

  • Archives

Archive for the ‘Application’ Category

Dialog Focus

Posted by Rob Camick on March 14, 2010

When a JDialog (or JFrame for that matter) is made visible, focus is placed on the first focusable component by default. There may be times when you want to change this behaviour. The obvious solution would be to invoke the requestFocusInWindow() method on the component you wish to receive focus. The problem is that this doesn’t work all the time.
Read the rest of this entry »

Advertisements

Posted in Application, Swing, Tips | 40 Comments »

Visual Font Designer

Posted by Darryl Burke on November 30, 2008

New in version 2: VisualFontDesigner can now be used as a Font chooser, much on the lines of JColorChooser

When trying to create an attractive Font, the first challenge is usually to research the difference that applicable attributes make to its appearance. Applying and reviewing numerous combinations of attributes can be a tedious exercise.

VisualFontDesigner makes it a breeze to quickly visualize the effects of most of the available attributes, with the added bonus of generating a code block that can be directly copied to recreate the font elsewhere.

Read the rest of this entry »

Posted in Application, Awt | 4 Comments »

Key Bindings

Posted by Rob Camick on October 10, 2008

All Swing components use Key Bindings, but what are they? Well, have you ever wondered how the “copy” functionality of a text component works? The KeyStroke (Ctrl+C) is used to invoke an Action (copy). So a key binding is simply the mapping of a KeyStroke to an Action.
Read the rest of this entry »

Posted in Application, Swing | 12 Comments »

UIManager Defaults

Posted by Rob Camick on October 9, 2008

The UIManager contains information about the default properties of each Swing component. This information is stored in the UIDefaults class in the form of key/value pairs. Each Look and Feel will have its own set of default properties. The UIManager can be used to make changes to these properties.
Read the rest of this entry »

Posted in Application, Swing | 35 Comments »