180 likes | 338 Views
CS-434: Object-Oriented Programming Using Java Week 4. Dr. Jesús Borrego Adjunct Faculty Regis University. Class Outline. Review of Homework 3 and 4 Key Terms Sample Program – in class Midterm Exam Questions?. MVC. Model, View, Controller View – renders the user interface to user
E N D
CS-434: Object-Oriented Programming Using JavaWeek 4 Dr. Jesús Borrego Adjunct Faculty Regis University
Class Outline Review of Homework 3 and 4 Key Terms Sample Program – in class Midterm Exam Questions?
MVC Model, View, Controller View – renders the user interface to user Controller – handles user events through the user interface Model – responsible for the entire application
Java UI Frameworks Abstract Windowing Toolkit (AWT) – uses native API to render graphics Java 2D – draws 2 dimensional graphics that are independent of OS Swing – rich set of components to create user interfaces; built on top of J2D and AWT
AWT Components • Require: • import java.awt.*; • import jave.awt.event.*; • import javax.swing.*; • Top level containers: • Jframe – main window • Jdialog – dialog window • JApplet – runs in a web page
Containers • General Purpose: • JPanel – container of widgets • JScrollPane – container with scroll bars • JSplitPlane – container with split panes • JTabbedPane – container with tabs • JToolBar – Container with task bars • Special Purpose: • JInternalPane, JLayeredPane, RootPane
Controls (Cont’d) Jbutton, JCheckBox, JComboBox, JList, JMenu, JMenuItem, JRadioButton, JSlider, JSpinner, JTextField, JPasswordField JColorChooser, JEditorPane, JFieldChooser, JTable, JTextArea, Jtree JLabel, JProgressBar, Jseparator, JToolTip
Review of Homework 1 Create a use case diagram for a library Include actors, use cases, and relations between users and use cases Prefer use of Visio More details in WorldClass (Case Study_Library Application)
Event Listeners Listen to events from user interface User interacts with the graphical component Mouse clicks generate events Event listeners respond to events
Building an User Interface - Steps • Detailed steps in WorldClass, Content area, Week 4: • Building a User Interface using NetBeans Drag and Drop
Homework 5 • Create a User Interface for the library system (one per student): • Log On • Book Interface (check out, add, check in, delete) • Customer Interface (add, view, display items checked out) • Inventory Interface (Search, List)
Review of Homework 2 Create a Hello World program using NetBeans Capture screen where it shows the package and results Submit to WorldClass before week 2
Key Terms Constructor - Constructor Inheritance - Herencia Interface – Interfaz Overloading – Sobrecargar Package – Paquete Polymorphism - Polimorfismo