|
-
March 2nd, 2000, 12:43 PM
#1
Java L&F
hi everybody
I don't know how to change look and feel in java program. I tried smth like that
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
but in both cases the main frame looked the same.
Here is my whole source
class MyClass {
public static void main(String args[]) {
JFrame mainFrame = new JFrame("Yabba dabba doo");
mainFrame.addWindowListener(new WindowAdapter(){
public void windowClosing( WindowEvent e) { System.exit(0); }
});
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception exc) {
System.err.println("Error loading L&F: " + exc);
}
mainFrame.pack();
mainFrame.setSize(600,200);
mainFrame.setVisible(true);
}
}
Please somebody help me with an example how to change between L&F.
thnx Seyo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|