Advanced GUI Programming

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

Java GUI building with the AWT. AWT (Abstract Window Toolkit) Present in all Java implementations Described in (almost) every Java textbook Adequate for.
Introduction to Swing Components Chapter 14. Part of the Java Foundation Classes (JFC) Provides a rich set of GUI components Used to create a Java program.
Graphical User Interfaces
Java Software Development Paradigm Lecture # 12. Basics of GUI.
Graphic User Interfaces Layout Managers Event Handling.
Corresponds with Chapter 12
 What are the basic GUI components we’ve learned so far? › JFrame › JPanel › JButton › JLabel › JTextArea › JTextField › JCheckBox › JRadioButton › Paint.
Understanding SWING Architecture CS 4170 UI Design Hrvoje Benko Oct. 9, 2001.
Graphical User Interfaces (GUIs) GUI: An application that uses graphical objects to interact with users GUI applications consist of: –Events: A user or.
Swing CS-328 Dick Steflik John Margulies. Swing vs AWT AWT is Java’s original set of classes for building GUIs Uses peer components of the OS; heavyweight.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 14 GUI and Event-Driven Programming.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 14 GUI and Event-Driven Programming.
1 GUI Elements in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
Scott Grissom, copyright 2006Ch 11: GUI Slide 1 Graphical User Interfaces (Ch 11) Careful design of a graphical user interface is key to a viable software.
GUI and event-driven programming An introduction.
CPSC150 Week 12 Graphical User Interfaces Chapter 11.
CS3 - AWT/Swing1 The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness –The Abstract.
Java Programming Chapter 10 Graphical User Interfaces.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Using Inheritance to Customize Frames Use inheritance for complex frames to make programs easier to understand Design a subclass of JFrame Store the components.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Object Oriented Programming Ders 11: Interfaces Mustafa Emre İlal
Java Programming: Advanced Topics 1 Common Elements of Graphical User Interfaces Chapter 6.
10/24/20151 Java GUI Programming. 10/24/20152 What is a GUI? Java has standard packages for creating custom Graphical User Interfaces Some of the fundamental.
GUI development in Java L. Grewe Two methodologies for things to appear on the screen 1. By painting / drawing e.g. drawing an Image e.g. drawing an.
Swing Differences between Swing and AWT Naming Conventions All Swing components begin with a capital J -- JPanel, JButton, JScrollBar, JApplet, etc..
Object Oriented programming Instructor: Dr. Essam H. Houssein.
Object Oriented Programming Engr. M. Fahad Khan Lecturer, Software Engineering Department University of Engineering & Technology, Taxila.
CSCI Swing1 The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness –The Abstract.
CS Fall 2012, Lab 09 Haohan Zhu. Boston University Slideshow Title Goes Here CS Fall 2012, Lab /20/2015 GUI - Graphical User Interface.
GUI Basics. What is GUI? A graphical user interface (GUI) is a type of user interface item that allows people to interact with programs in more ways than.
The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: a rich set of user interface components; a.
CS1054: Lecture 21 - Graphical User Interface. Graphical User Interfaces vs. Text User Interface.
Swing Components. Introduction Swing – A set of GUI classes – Part of the Java's standard library –Much better than the previous library: AWT Abstract.
GUIs Graphical User Interfaces. Everything coming together Known: – Inheritance – Interfaces – Abstract classes – Polymorphism – Exceptions New: – Events.
Introduction to Java Chapter 9 - Graphical User Interfaces and Applets1 Chapter 9 Graphical User Interfaces and Applets.
5-Jan-16 R Ramesh Swing. 5-Jan-16 R Ramesh An Introduction to Java Foundation Classes (JFC) A suite of libraries to assist programmers create enterprise.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
Graphical User Interfaces Tonga Institute of Higher Education.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 15 : Swing III King Fahd University of Petroleum & Minerals College of Computer.
CSI 3125, Preliminaries, page 1 Layout Managers. CSI 3125, Preliminaries, page 2 Layout Managers The LayoutManagers are used to arrange components in.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 7-3 ( Book Chapter 14) GUI and Event-Driven Programming.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Introduction to GUI in 1 Graphical User Interface 3 Nouf Almunyif.
Introduction to GUI Programming in Java: Frames, Simple Components, and Layouts.
Getting Started with GUI Programming Chapter 10 CSCI 1302.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
Chapter 7 A First Look at GUI Applications Layout Managers.
Java Swing What is swing? Swing is a ”Lightweight” GUI ToolKit for Java Different from AWT / SWT Toolkits for GUIs Few lines of code to produce GUI elements.
A Quick Java Swing Tutorial
Chapter 9: Graphical User Interfaces
Provision for GUIs in Java
Christopher Budo, Davis Nygren, spencer franks, Luke miller
Modern Programming Language Java
Provision for GUIs in Java
Lecture 27 Creating Custom GUIs
Tim McKenna Layout Mangers in Java Tim McKenna
Chapter 13: Advanced GUIs and Graphics
Containers and Components
Tim McKenna Layout Mangers in Java Tim McKenna
Creating Graphical User Interfaces
Panels & Layout Managers
Graphical User Interface
Chapter 7-3 (Book Chapter 14)
Advanced GUIs and Graphics
Graphical User Interface
Presentation transcript:

Advanced GUI Programming Austin Fahsl, Austin May, Shane Bruggeman

A Quick Review Purpose: Implementation: Result: Guide the user Swing & AWT Result: Modular coding Ease of access

AWT vs Swing AWT Swing Abstract Windows Toolkit Heavyweight Native code counterparts handle functionality All the features of AWT Lightweight Handles its own functionality

FlowLayout, BorderLayout, GridLayout, GroupLayout Box Layout Border Layout Grid Layout Layout Managers FlowLayout, BorderLayout, GridLayout, GroupLayout

Layout Managers Flow Layout Border new BorderLayout(); new FlowLayout(); Places elements (in the order added) to the screen. Starts a new line if the elements do not fit the current one new BorderLayout(); Places elements into tpredetermined spaces on the tcomponent NORTH, SOUTH, EAST, WEST, CENTER

Layout Managers Grid Layout Box Layout new GridLayout(int rows, int columns, panel) Components take up all the space on the holder new BoxLayout(panel, axis); Axis can be horizontal or vertical BoxLayout.LINE_AXIS BoxLayout.PAGE_AXIS BoxLayout.X_AXIS BoxLayout.Y_AXIS

Exploring New JComponents JSlider JScrollPane & JMenu JTable JRadioButton JToolbar Exploring New JComponents JTable, JRadioButton, JSlider, Jmenu, JScrollPane

New JComponents JSlider JScrollPane JTable Make changes by “sliding” the bar Use ChangeListener to detect sliding Jslider slider = new JSlider(); Allows for windows larger than screen Extends Panel and adds a scroll option JScrollPane pane = new JScrollPane(); Easy data organization Should be added to a JScrollPane JTable table = new JTable(); and scrollpane.getViewport().add(table);

New JComponents JMenu JRadioButton JToolBar Jmenu  JMenuBar  Jmenu  JMenuItem Useful for holding many options in categories ButtonGroup  JRadioButton Useful for chosing “one” option JToolBar  Jcomponents . . . . Provides easy access to menu options

Images & Adding Images To JButtons BufferedImage & Image Classes Image image = ImageIO.read(new File(file)) BufferedImage image = ImageIO.read(new File(file)) button.setIcon(new ImageIcon(file));

http://math. hws. edu/eck/cs124/javanotes6/c13/index. html http://docs http://math.hws.edu/eck/cs124/javanotes6/c13/index.html http://docs.oracle.com/javase/7/docs/api/ http://docs.oracle.com/javase/tutorial/uiswing/components/toolbar.html http://www.stackoverflow.com Sources