120 likes | 235 Views
User interface. Widget toolkits. AWT Swing JavaFX SWT (Eclipse). AWT and Swing. Look&Feel. CrossPlatformLookAndFeel SystemLookAndFeel ( Windows, Motif/GTK ) Synth (Nimbus). Look&Feel. try { UIManager.setLookAndFeel ( " javax.swing.plaf.metal.MetalLookAndFeel ");
E N D
Widget toolkits • AWT • Swing • JavaFX • SWT (Eclipse) • ...
Look&Feel • CrossPlatformLookAndFeel • SystemLookAndFeel (Windows, Motif/GTK) • Synth (Nimbus)
Look&Feel try { UIManager.setLookAndFeel( "javax.swing.plaf.metal.MetalLookAndFeel"); // UIManager.setLookAndFeel( // UIManager.getSystemLookAndFeelClassName()); // SwingUtilities.updateComponentTreeUI(this); } catch (Exception e){ //Exception handle }
Hello, World! import javax.swing.*; public final class HelloWorld implements Runnable { public static void main(String[] args) { SwingUtilities.invokeLater(new HelloWorld()); } public void run() { JFrame f = new JFrame("Hello, World!"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(new JLabel("Hello World")); f.pack(); f.setVisible(true); } }