Java Reference
In-Depth Information
thisButton = me ;
}
/** Called when the button actually gets pressed. */
public
public void
void actionPerformed ( ActionEvent e ) {
try
try {
UIManager . setLookAndFeel ( theLNFName );
SwingUtilities . updateComponentTreeUI ( theFrame );
theFrame . pack ();
} catch
catch ( Exception evt ) {
JOptionPane . showMessageDialog ( null
null ,
"setLookAndFeel didn't work: " + evt ,
"UI Failure" , JOptionPane . INFORMATION_MESSAGE );
previousButton . setSelected ( true
true );
// reset the GUI to agree
}
previousButton = thisButton ;
}
}
public
public static
void main ( String [] argv ) {
LNFSwitcher o = new
static void
new LNFSwitcher ();
o . theFrame . setVisible ( true
true );
}
}
See Also
You can find some alternative look-and-feel implementations on the Web. If you'd like to
build your own look and feel, perhaps for corporate identity reasons, some of these, in con-
junction with O'Reilly's Java Swing , would be a good starting point.
Enhancing Your Swing GUI for Mac OS X
Problem
You tried running your Swing GUI application on Mac OS X, and it didn't look right.
Search WWH ::




Custom Search