GUIs - Part 1 (11)

GUIs - Part 1 (11) - COP 3330: Object-Oriented Programming...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3330: GUIs In Java – Part 1 Page 1 © Dr. Mark Llewellyn COP 3330: Object-Oriented Programming Summer 2011 Introduction To GUIs and Event-Driven Programming In Java – Part 1 Department of Electrical Engineering and Computer Science Computer Science Division University of Central Florida Instructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cop3330/sum2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COP 3330: GUIs In Java – Part 1 Page 2 © Dr. Mark Llewellyn Java GUIs (Graphical User Interfaces) • The overall design of the API for Java GUI programming is an excellent example of how the object-oriented design principle can be applied. • You can clearly see the inheritance hierarchy displayed in the GUI API in the UML diagram on the next page.
Background image of page 2
COP 3330: GUIs In Java – Part 1 Page 3 © Dr. Mark Llewellyn The Java GUI Hierarchy Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * Recall UML notation for composition – i.e. a container can contain many components. Recall UML notation for aggregation – i.e. a container “has-a” layout manager.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COP 3330: GUIs In Java – Part 1 Page 4 © Dr. Mark Llewellyn Java GUIs (Graphical User Interfaces) The GUI classes can be classified into three groups: container classes , component classes , and helper classes . The container classes, such as JFrame, JPanel , and JApplet , are used to contain other components. The GUI component classes, such as JButton, JTextField, JTextArea , etc., are subclasses of JComponent . The GUI helper classes, such as Graphics, Color, Font , etc., are used to support GUI components. These are illustrated with UML class diagrams on the next two pages.
Background image of page 4
COP 3330: GUIs In Java – Part 1 Page 5 © Dr. Mark Llewellyn The Container Classes Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * JPanel Container classes can contain other GUI components.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COP 3330: GUIs In Java – Part 1 Page 6 © Dr. Mark Llewellyn The GUI Helper Classes Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * JPanel The helper classes are not subclasses of Component . They are used to describe the properties of GUI components such as graphics context, colors, fonts, and dimension.
Background image of page 6
COP 3330: GUIs In Java – Part 1 Page 7 © Dr. Mark Llewellyn Swing vs. AWT (Abstract Windows Toolkit) When Java was introduced, the GUI classes were bundled into a library known as the Abstract Windows Toolkit (AWT).
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 51

GUIs - Part 1 (11) - COP 3330: Object-Oriented Programming...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online