1 / 9

Advanced GUI

Advanced GUI. David Fishman Jenny Levey. Advanced GUI. What are the basic GUI components we’ve learned so far? JFrame JPanel JButton JLabel JTextArea JTextField JCheckBox JRadioButton Paint Border, Flow, and Grid Layouts. There are more! . What other Components are there? JMenu

Download Presentation

Advanced GUI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced GUI David Fishman Jenny Levey

  2. Advanced GUI • What are the basic GUI components we’ve learned so far? • JFrame • JPanel • JButton • JLabel • JTextArea • JTextField • JCheckBox • JRadioButton • Paint • Border, Flow, and Grid Layouts

  3. There are more! • What other Components are there? • JMenu • JMenuBar • JTabbedPane • JOptionPane • MessageDialog • ConfirmDialog • InputDialog • JScrollPane • JTable • JColorChooser • JFileChooser • JTree • JSplitPane • JProgressBar

  4. Menus • JMenu is a traditional pop-down list • Menus such as File and Edit • JMenuBar contains the menu items • Menu list that pops up at the top of Eclipse

  5. Panes • JTabbedPane is a panel referenced by a tab • Mozilla Firefox • JOptionPane is a panel that pops up with options for the user to choose from • Dialog box for exit • JScrollPane is a panel with a scrollbar • Most internet browsers • JSplitPane displays two adjacent panels • Eclipse

  6. Other • JTable is a displayed table • Excel table • JColorChooser is a color selection panel • Paint • JFileChooser allows the user to browse for files • File: Open • JTree is a visual tree of data • Eclipse: Package Explorer • JProgressBar is a progress bar • Installation progress bar

  7. Adding Images to a Frame • Create an Image Icon out of the image • Create a new component and pass it the ImageIcon • Add it to the Frame ( this.add(button); )

  8. DEMO CODE! • Open Demo Code • Check it out, play around. In the tab window, try “gopher.gif”, ”hamster.gif”, ”alien.gif”, ”ninja.gif”, ”plat.gif”.

  9. YOUR TASK! • Create a new JMenu and add items corresponding to each of the images. • When these are clicked, it should open up the image in a new window. • Remember, the images are “gopher.gif”, ”hamster.gif”, ”alien.gif”, ”ninja.gif”, ”plat.gif”.

More Related