User interface

Post on 08-Jan-2016

21 views 1 download

Tags:

description

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 "); - PowerPoint PPT Presentation

Transcript of User interface

User interface

Widget toolkits

• AWT• Swing• JavaFX• SWT (Eclipse)• ...

AWT and Swing

Look&Feel

• CrossPlatformLookAndFeel• SystemLookAndFeel (Windows, Motif/GTK)• Synth (Nimbus)

Look&Feeltry { UIManager.setLookAndFeel( "javax.swing.plaf.metal.MetalLookAndFeel");// UIManager.setLookAndFeel(//

UIManager.getSystemLookAndFeelClassName());// SwingUtilities.updateComponentTreeUI(this); } catch (Exception e){ //Exception handle}

JTable Demo Metal

JTable Demo Nimbus

JTable Demo Windows

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); }}

AWT Layout managers

Swing Layout managers

Q&A