42 |
{ |
{ |
43 |
if (System.getProperty("swing.defaultlaf") == null) |
if (System.getProperty("swing.defaultlaf") == null) |
44 |
{ |
{ |
45 |
|
UIManager.setLookAndFeel(new GNULookAndFeel()); |
46 |
|
|
47 |
StringBuffer text = new StringBuffer(); |
StringBuffer text = new StringBuffer(); |
48 |
text.append("\tYou may change the Look and Feel of this\n"); |
text.append("You may change the Look and Feel of this\n"); |
49 |
text.append("\tDemo by setting the system property\n"); |
text.append("Demo by setting the system property\n"); |
50 |
text.append("\t-Dswing.defaultlaf=<LAFClassName>\n\n"); |
text.append("-Dswing.defaultlaf=<LAFClassName>\n"); |
51 |
text.append("\tPossible values for <LAFClassName> are:\n"); |
text.append("\n"); |
52 |
text.append("\t * javax.swing.plaf.metal.MetalLookAndFeel\n"); |
text.append("Possible values for <LAFClassName> are:\n"); |
53 |
text.append("\t\tthe default Java L&F\n"); |
text.append("\n"); |
54 |
text.append("\t * gnu.classpath.examples.swing.GNULookAndFeel\n"); |
text.append("* javax.swing.plaf.metal.MetalLookAndFeel\n"); |
55 |
text.append("\tthe GNU Look and Feel\n"); |
text.append(" the default GNU Classpath L&F\n"); |
56 |
text.append("\t(derived from javax.swing.plaf.basic.BasicLookAndFeel\n\n"); |
text.append("\n"); |
57 |
text.append("\tthe default is gnu.classpath.examples.swing.GNULookAndFeel\n"); |
text.append("* gnu.classpath.examples.swing.GNULookAndFeel\n"); |
58 |
|
text.append(" the GNU Look and Feel\n"); |
59 |
|
text.append(" (derived from javax.swing.plaf.basic.BasicLookAndFeel)\n"); |
60 |
|
text.append("\n"); |
61 |
|
text.append("the default is gnu.classpath.examples.swing.GNULookAndFeel\n"); |
62 |
JEditorPane textPane = new JEditorPane(); |
JEditorPane textPane = new JEditorPane(); |
63 |
// temporary hack, preferred size should be computed by the |
// temporary hack, preferred size should be computed by the |
64 |
// component |
// component |
67 |
JOptionPane.showMessageDialog(null, textPane, |
JOptionPane.showMessageDialog(null, textPane, |
68 |
"Look and Feel notice", |
"Look and Feel notice", |
69 |
JOptionPane.INFORMATION_MESSAGE); |
JOptionPane.INFORMATION_MESSAGE); |
|
|
|
|
UIManager.setLookAndFeel(new GNULookAndFeel()); |
|
70 |
} |
} |
71 |
} |
} |
72 |
catch (UnsupportedLookAndFeelException e) |
catch (UnsupportedLookAndFeelException e) |