Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 112 - Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 2 11/20/2015 GUI - Graphical User Interface.

Similar presentations


Presentation on theme: "CS 112 - Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 2 11/20/2015 GUI - Graphical User Interface."— Presentation transcript:

1 CS 112 - Fall 2012, Lab 09 Haohan Zhu

2 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 2 11/20/2015 GUI - Graphical User Interface  JFC - Java Foundation Classes  An API for providing a graphical user interface (GUI) for Java programs.  Include AWT, Swing and Java 2D.

3 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 3 11/20/2015 GUI widget toolkit  Swing  Primary Java GUI widget toolkit  AWT  Original platform-independent windowing, graphics, and user-interface widget toolkit.  SWT

4 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 4 11/20/2015 Swing  Top-Level Containers  JFrame, JDialog, and Japplet

5 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 5 11/20/2015 Swing  General-Purpose Containers  JPanel, JScrollPane, JSplitPane, and so on  Special-Purpose Containers  JInternalFrame, JLayeredPane and Root pane

6 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 6 11/20/2015 JPanel  JPanel()  Creates a new JPanel with a double buffer and a flow layout.  JPanel(LayoutManager layout)  Create a new buffered JPanel with the specified layout manager  setLayout(LayoutManager layout)

7 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 7 11/20/2015 LayoutManage  Interface  FlowLayout  BorderLayout  GridLayout  …

8 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 8 11/20/2015 Jcomponent  All Swing components whose names begin with "J" descend from the JComponent class  JButton  JCheckBox  JComboBox  JRadioButton  JTextField  Jtable  …

9 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 9 11/20/2015 Jbutton  ActionListener  Interface  http://docs.oracle.com/javase/7/docs/api/java/awt/event/ ActionListener.html http://docs.oracle.com/javase/7/docs/api/java/awt/event/ ActionListener.html  actionPerformed(ActionEvent e)  ActionEvent  Class  Click a button, create an event

10 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 10 11/20/2015 JOptionPane  JOptionPane.showMessageDialog();

11 Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 11 11/20/2015 Practice  Finish the code  Learn how to write a GUI


Download ppt "CS 112 - Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS 112 - Fall 2012, Lab 09 2 11/20/2015 GUI - Graphical User Interface."

Similar presentations


Ads by Google