Advanced OOP MCS-3 OOP BSCS-3 Lecture # 9. GUI Components - > JFrame ->JComboBoxGUI Components - > JFrame ->JComboBox (javax.Swing.JComboBox) JComboBox()

Slides:



Advertisements
Similar presentations
1 Graphical User Interface (GUI) Applications Abstract Windowing Toolkit (AWT) Events Handling Applets.
Advertisements

GUI Elements Session 17. Memory Upload Layout Components Button TextField TextArea Label Choice Containers Panels The applet itself.
Graphical User Interfaces
TCU CoSc Programming with Java Visual Design (Chapter 5)
More on GUI We wrap up our examination of Java GUI programming by looking at several other components and their listeners – The components all come from.
CMSC 341 Building Java GUIs. 09/26/2007 CMSC 341 GUI 2 Why Java GUI Development? Course is about Data Structures, not GUIs. We are giving you the opportunity.
Fall 2007CS 225 Graphical User Interfaces Event Handling Appendix C.
Java GUI Libraries Swing Programming. Swing Components Swing is a collection of libraries that contains primitive widgets or controls used for designing.
Slides prepared by Rose Williams, Binghamton University Chapter 17 Swing I.
Unit 131 GUI Layout Managers Learning Outcomes oList and distinguish between the four most common, standard layout managers in Java. oUse these and other.
Swinging Into Swing Leo S. Primero III. Understanding what Swing Is Swing is a package that lets you create applications that use a flashy Graphical User.
CS102--Object Oriented Programming Lecture 19: – The Swing Package (II) Copyright © 2008 Xiaoyan Li.
Chapter 13: Advanced GUIs and Graphics J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition.
GUI and event-driven programming An introduction.
Chapter 13 Advanced GUIs and Graphics. Chapter Objectives Learn about applets Explore the class Graphics Learn about the class Font Explore the class.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 12 Advanced GUIs and Graphics.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
CSE 219 Computer Science III Graphical User Interface.
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.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Object Oriented programming Instructor: Dr. Essam H. Houssein.
More GUIs, events, static. model.addElement(335); model.addElement(436); } private JTextArea lineDisplay = new JTextArea("Could have\nseveral lines\nhere");
Applets and Frames. Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L14: GUI Slide 2 Applets Usually.
 GUI – Graphic User Interface  Up to now in the programs we have written all output has been sent to the standard output device i.e.: the DOS console.
CS1054: Lecture 21 - Graphical User Interface. Graphical User Interfaces vs. Text User Interface.
Software Constructions LAB 09 Java Programming with SWING GUI Builder-Part III.
Introduction to GUI in 1 Graphical User Interface 2 Nouf Almunyif.
1 GUIs, Layout, Drawing Rick Mercer. 2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces (GUIs)
Getting Input. Text Fields A text field is a box that the user can type in Use the JTextField class JTextField tf1 = new JTextField(15); 15 is the field.
Topic 13 List Boxes. JList Generates an ListSelectionEvent Event monitored by ListSelectionListener ListSelectionListener invokes method valueChanged.
Slides prepared by Rose Williams, Binghamton University ICS201 Lecture 14 : Swing II King Fahd University of Petroleum & Minerals College of Computer Science.
Basics of GUI Programming Chapter 11 and Chapter 22.
J McQuillanSE204:2004/2005: Lecture 3Slide 1 Specialised Components Can create specialised components. Do this by subclassing the component that you are.
1 Chapter 16: Creating Windows. 2 Basics of GUI Programming How to create a Window. TryWindow.java You always need a JFrame component before creating.
Creating a Window. A basic window in Java is represented by an object of the class Window in the package java.awt.
Ajmer Singh PGT(IP) JAVA IDE Programming - I. Ajmer Singh PGT(IP) GUI (Graphical User Interface) It is an interface that uses a graphic entities along.
GUI Components CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 6. TOPICS TO COVER GUI Components - > JframeGUI Components - > Jframe (javax.Swing.JFrame) JFrame() JFrame(String)
Graphical User Interfaces Tonga Institute of Higher Education.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
1 Event Driven Programs with a Graphical User Interface Rick Mercer.
 Many event-listener interfaces contain multiple methods.  An adapter class implements an interface and provides a default implementation (with an empty.
1 Layout Managers Layout managers –Provided for arranging GUI components –Provide basic layout capabilities –Processes layout details –Programmer can concentrate.
CSI 3125, Preliminaries, page 1 Layout Managers. CSI 3125, Preliminaries, page 2 Layout Managers The LayoutManagers are used to arrange components in.
Java Layouts CSIS 3701: Advanced Object Oriented Programming.
Java Swing Controls. JButton One of the most commonly used swing component is Push Button or simply button which is created through JButton class of Swing.
Chapter 10 - Writing Graphical User Interfaces1 Chapter 10 Writing Graphical User Interfaces.
Introduction to GUI in 1 Graphical User Interface 3 Nouf Almunyif.
CSC 205 Programming II Lecture 7 AWT – Event Handling & Layout.
5-1 GUIs and Events Rick Mercer. 5-2 Event-Driven Programming with Graphical user Interfaces  Most applications have graphical user interfaces to respond.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
Dept. of CSIE, National University of Tainan 10/21/2012 Arranging Components on a User Interface.
GUIs & Event-Driven Programming Chapter 11 Review.
Introduction to Swing Mr. Crone. What is Swing? a collection of pre-made Java classes used to create a modern graphical user interface.
Prepared by: Dr. Abdallah Mohamed, AOU-KW Unit 6 Graphical user interfaces 1.
Advanced OOP MCS-3 OOP BSCS-3 Lecture # 7. GUI Components - > Jframe ->JPasswordField (javax.Swing.JPasswordField) GUI Components - > Jframe ->JPasswordField.
Unit 131 GUI Layout Managers Learning Outcomes oList and distinguish between the four most common, standard layout managers in Java. oUse these and other.
Chapter 7 A First Look at GUI Applications Layout Managers.
GUIs and Events Rick Mercer.
Lecture 16 More GUI programming
Modern Programming Language Java
Java Swing.
Chapter 13: Advanced GUIs and Graphics
תכנות מכוון עצמים בשפת JAVA
Tim McKenna Layout Mangers in Java Tim McKenna
Graphical User Interface
Chapter 7-3 (Book Chapter 14)
Advanced Programming in Java
Zhen Jiang West Chester University
Advanced GUIs and Graphics
Presentation transcript:

Advanced OOP MCS-3 OOP BSCS-3 Lecture # 9

GUI Components - > JFrame ->JComboBoxGUI Components - > JFrame ->JComboBox (javax.Swing.JComboBox) JComboBox() JComboBox(Object[]) void addItem(Object) void insertItemAt(Object, int) Object getItemAt(int) int getMaximumRowCount() Object getSelectedItem() int getSelectedIndex() void removeAllItems() void removeItemAt(int) void removeItem(Object) void setEditable(boolean) void setMaximumRowCount(int) boolean isEditable() TOPICS TO COVER

GUI Components - > JFrame ->JList (javax.Swing.JList) GUI Components - > JFrame ->JList JList() JList(Object[]) voidaddSelectionInterval(int, int) void clearSelection() int getSelectedIndex() int[] getSelectedIndices() Object getSelectedValue() Object[] getSelectValuesList() int getVisibleRowCount() boolean isSelectedIndex(int)//index boolean isSelectionEmpty() void setSelectedIndex(int)//index void setSelectedIndices(int[]) void setToolTipText(String) void setVisibleRowCount(int) TOPICS TO COVER

GUI Components - > JFrame ->JList GUI Components - > JFrame ->JList Single Selection Lists ListSelectionModel.SINGLE_SELECTION Multiple Selection Lists ListSelectionModel.SINGLE_INTERVAL_SELECTION ListSelectionModel.MULTIPLE_INTERVAL_SELECTION int getSelectionMode() void setSelectionMode(int)// selectionMode void setModel(DefaultListModel)// for adding elements in spite of constructor Javax.swing.DefaultListModel DefaultListModel() void addElement(String) TOPICS TO COVER

Ways of Arranging Components in GUI Uses Container class setLayout() method from java.awt package Absolute Positioning Provides greatest level of control by setting setLayout method to null. But it can be tedious to set absolute positioning. Methods like setSize, setLocation, and setBounds are used. Layout Managers FlowLayout BorderLayout GridLayout Visual Programming in an IDE Provides GUI design tool. Supports drag and drop.

GOOD LUCK ! ☻...