JList. Displays a series of items The user can select one or more items Class JList extends directly class Jcomponent Class Jlist supports

Size: px
Start display at page:

Download "JList. Displays a series of items The user can select one or more items Class JList extends directly class Jcomponent Class Jlist supports"

Transcription

1 GUI Component - 4

2 JList Displays a series of items The user can select one or more items Class JList extends directly class Jcomponent Class Jlist supports Single-selection lists: one item to be selected at a time Multiple-selection lists: any number of items can be selected(ctrl,shift)

3 Jlist - event ListSelectionEvent Handled by ListSelectionListener that should implement the method valuechanged

4 JList Does not provide a scrollbar??!! The scrollbar can be provided using JScrollPane where the scrollbar appears at the right side of Jlist The scrollbar appears only when the number of items in the list exceeds the number of visible items. To register add the method: addlistselectionlistener

5 Constructors JList() Constructs an empty list Jlist(object[] listdata) Constructs a list that contains the data in listdata Example: private String size[]={ 12, 14, 16, 18, 20, 22 }; list1= new Jlist(size);

6 Methods void setvisiblerowcount(int visiblerowcount) Sets the number of rows that can be visible void setselectionmode(int selectionmode) Determines whether single or multiple items can be selected: ListSelectionModel.SINGLE_SELECTION Only one list index can be selected at a time. ListSelectionModel.SINGLE_INTERVAL_SELECTION One contiguous index interval can be selected at a time. ListSelectionModel.MULTIPLE_INTERVAL_SELECTION In this mode, there's no restriction on what can be selected. int getselectionindex() Returns the first selected index, -1 if nothing is selected void setfixedcellhieght(int height) Sets the heights of every cell in the list (in pixels) void setfixedcellwidth(int width) Sets the width of every cell in the list

7 Methods void setselectedindex(int x) Sets the selected index to x void setlistdata(object[] listdata) Constructs a ListModel from an array of objects object getselectedvalue() Returns the first selected value, null if no selection object getselectedvalues() Returns an array of the values for the selected cells void valuchanged(listselectionevent e) Called whenever the value of the selection changed

8 NOTE There are no events to indicate that a user has made multiple selections in a multipleselection list. Another GUI componenet should be used to specify when the multiple selection should be processed (known as external event)

9 JTextArea Area to manipulate multiple lines of text Subclass of JTextComponent No action event: an external event indicates when to process the text. No scrollbar No wrap lines.

10 Constructors JTextArea() JTextArea (int rows, int cols) New empty text area with the specified number of row and columns JTextArea(String text) New text area with the specified text JTextArea(String text, int rows, int cols) New text area with specified text and no. of cols and rows.

11 Methods void setlinewrap(boolean wrap) String getselectedtext() void settext(string text) void setreditable(boolean b) String gettext() void append(string s)

12 JComboBox List of items from which the user can make a single selection Also called a drop-down list JComboBox provides a scrollbar that allow the user to scroll through all the elements For each item selected from a JcomboBox, another item is unselected

13 Constructor JComboBox(object[] items) Creates a JComboBox that contains the elements in the specified array.

14 Methods void additemlistener(itemlistener a) void setmaximumrowcount(int count) Sets the maximum number of rows. int getselectedindex() Returns the first item in the list that matches the given item object getselecteditem() Return the current selected item int getstatechange() Returns the type of change (selected or not)

15 Quiz 10 min If you read this before the class you can solve the quiz and bring the solution to the class tomorrow. Write java statements that are needed to do the following: Constructs a list that contains: A, B, C, D, E, F, G For the previous list write a statement to: Determine that the number of item to be showed is 4 Allow the user to select any number of items Add scrollbar Show how the action will be performed when the user select more than one item

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 10(b): Working with Controls Agenda 2 Case study: TextFields and Labels Combo Boxes buttons List manipulation Radio buttons and checkboxes

More information

12/22/11. Copyright by Pearson Education, Inc. All Rights Reserved.

12/22/11. Copyright by Pearson Education, Inc. All Rights Reserved. } Radio buttons (declared with class JRadioButton) are similar to checkboxes in that they have two states selected and not selected (also called deselected). } Radio buttons normally appear as a group

More information

JAVA NOTES GRAPHICAL USER INTERFACES

JAVA NOTES GRAPHICAL USER INTERFACES 1 JAVA NOTES GRAPHICAL USER INTERFACES Terry Marris July 2001 8 DROP-DOWN LISTS 8.1 LEARNING OUTCOMES By the end of this lesson the student should be able to understand and use JLists understand and use

More information

Chapter 17 Creating User Interfaces

Chapter 17 Creating User Interfaces Chapter 17 Creating User Interfaces 1 Motivations A graphical user interface (GUI) makes a system user-friendly and easy to use. Creating a GUI requires creativity and knowledge of how GUI components work.

More information

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7 PROGRAMMING DESIGN USING JAVA (ITT 303) Graphical User Interface Unit 7 Learning Objectives At the end of this unit students should be able to: Build graphical user interfaces Create and manipulate buttons,

More information

Swing. Component overview. Java UI, summer semester 2017/2018 1

Swing. Component overview. Java UI, summer semester 2017/2018 1 Swing Component overview 1 Label class JLabel for displaying short text image both 2 Buttons many kinds of buttons all of them extends AbstractButton regular button (JButton) "click" button toggle button

More information

JAVA NOTES GRAPHICAL USER INTERFACES

JAVA NOTES GRAPHICAL USER INTERFACES 1 JAVA NOTES GRAPHICAL USER INTERFACES Terry Marris 24 June 2001 5 TEXT AREAS 5.1 LEARNING OUTCOMES By the end of this lesson the student should be able to understand how to get multi-line input from the

More information

11/27/2007 TOPICS CHAPTER TOPICS LISTS READ ONLY TEXT FIELDS. Advanced GUI Applications. This module discusses the following main topics:

11/27/2007 TOPICS CHAPTER TOPICS LISTS READ ONLY TEXT FIELDS. Advanced GUI Applications. This module discusses the following main topics: Advanced GUI Applications TOPICS This module discusses the following main topics: The Swing and AWT Class Hierarchy Read-Only Text Fields Lists Combo Boxes Displaying Images in Labels and Buttons Mnemonics

More information

8/23/2014. Chapter Topics. Chapter Topics. Lists. Read Only Text Fields. Chapter 13: Advanced GUI Applications

8/23/2014. Chapter Topics. Chapter Topics. Lists. Read Only Text Fields. Chapter 13: Advanced GUI Applications Chapter 13: Advanced GUI Applications Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 13 discusses the following main topics: The Swing

More information

9/19/2018 Programming Data Structures. Polymorphism And Abstract

9/19/2018 Programming Data Structures. Polymorphism And Abstract 9/19/2018 Programming Data Structures Polymorphism And Abstract 1 In-class assignment: deadline noon!! 2 Overview: 4 main concepts in Object-Oriented Encapsulation in Java is a mechanism of wrapping the

More information

Advanced Swing GUI Applications

Advanced Swing GUI Applications CHAPTER 24 Advanced Swing GUI Applications TOPICS 24.1 The Swing and AWT Class Hierarchy 24.2 Read-Only Text Fields 24.3 Lists 24.4 Combo Boxes 24.5 Displaying Images in Labels and Buttons 24.6 Mnemonics

More information

GUI Event Handlers (Part II)

GUI Event Handlers (Part II) GUI Event Handlers (Part II) 188230 Advanced Computer Programming Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Department of Computer Engineering Khon Kaen University 1 Agenda Listener

More information

Goals. Lecture 7 More GUI programming. The application. The application D&D 12. CompSci 230: Semester JFrame subclass: ListOWords

Goals. Lecture 7 More GUI programming. The application. The application D&D 12. CompSci 230: Semester JFrame subclass: ListOWords Goals By the end of this lesson, you should: Lecture 7 More GUI programming 1. Be able to write Java s with JTextField, JList, JCheckBox and JRadioButton components 2. Be able to implement a ButtonGroup

More information

Programming: You will have 6 files all need to be located in the dir. named PA4:

Programming: You will have 6 files all need to be located in the dir. named PA4: PROGRAMMING ASSIGNMENT 4: Read Savitch: Chapter 7 and class notes Programming: You will have 6 files all need to be located in the dir. named PA4: PA4.java ShapeP4.java PointP4.java CircleP4.java RectangleP4.java

More information

Programming graphics

Programming graphics Programming graphics Need a window javax.swing.jframe Several essential steps to use (necessary plumbing ): Set the size width and height in pixels Set a title (optional), and a close operation Make it

More information

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class CHAPTER GRAPHICAL USER INTERFACES 10 Slides by Donald W. Smith TechNeTrain.com Final Draft 10/30/11 10.1 Frame Windows Java provides classes to create graphical applications that can run on any major graphical

More information

Graphical User Interfaces. Comp 152

Graphical User Interfaces. Comp 152 Graphical User Interfaces Comp 152 Procedural programming Execute line of code at a time Allowing for selection and repetition Call one function and then another. Can trace program execution on paper from

More information

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling Handout 12 CS603 Object-Oriented Programming Fall 15 Page 1 of 12 Handout 14 Graphical User Interface (GUI) with Swing, Event Handling The Swing library (javax.swing.*) Contains classes that implement

More information

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI CBOP3203 Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI components like button, text input, scroll bar and others.

More information

Chapter 12 Advanced GUIs and Graphics

Chapter 12 Advanced GUIs and Graphics Chapter 12 Advanced GUIs and Graphics Chapter Objectives Learn about applets Explore the class Graphics Learn about the classfont Explore the classcolor Java Programming: From Problem Analysis to Program

More information

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 143 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/

More information

Intro to Computer Science II. Exceptions

Intro to Computer Science II. Exceptions Intro to Computer Science II Exceptions Admin Exam review Break from Quizzes lab questions? JScrollPane JScrollPane Another swing class Allows a scrollable large component. JList? Constructors See next

More information

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1 Datenbank-Praktikum Universität zu Lübeck Sommersemester 2006 Lecture: Swing Ho Ngoc Duc 1 Learning objectives GUI applications Font, Color, Image Running Applets as applications Swing Components q q Text

More information

Summary. Section 14.1 Introduction. Section 14.2 Java s New Nimbus Look-and-Feel. 618 Chapter 14 GUI Components: Part 1

Summary. Section 14.1 Introduction. Section 14.2 Java s New Nimbus Look-and-Feel. 618 Chapter 14 GUI Components: Part 1 618 Chapter 14 GUI Components: Part 1 erence to a JScrollPane, the program can use JScrollPane methods sethorizontal- ScrollBarPolicy and setverticalscrollbarpolicy to change the scrollbar policies at

More information

Uppsala University. Assignment 3. Separation into Model-View TableModel ListModel ( multiple inheritance or adapter) Renderer (delegation)

Uppsala University. Assignment 3. Separation into Model-View TableModel ListModel ( multiple inheritance or adapter) Renderer (delegation) ToDo-list Assignment 3 Separation into Model-View TableModel ListModel ( multiple inheritance or adapter) Renderer (delegation) A new component Extend Swing with your own design Theme Modify look&feel

More information

Java Swing. Lists Trees Tables Styled Text Components Progress Indicators Component Organizers

Java Swing. Lists Trees Tables Styled Text Components Progress Indicators Component Organizers Course Name: Advanced Java Lecture 19 Topics to be covered Java Swing Lists Trees Tables Styled Text Components Progress Indicators Component Organizers AWT to Swing AWT: Abstract Windowing Toolkit import

More information

Overview. Lecture 7: Inheritance and GUIs. Inheritance. Example 9/30/2008

Overview. Lecture 7: Inheritance and GUIs. Inheritance. Example 9/30/2008 Overview Lecture 7: Inheritance and GUIs Written by: Daniel Dalevi Inheritance Subclasses and superclasses Java keywords Interfaces and inheritance The JComponent class Casting The cosmic superclass Object

More information

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"

More information

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun! Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques

More information

Page 1 of 7. public class EmployeeAryAppletEx extends JApplet

Page 1 of 7. public class EmployeeAryAppletEx extends JApplet CS 209 Spring, 2006 Lab 9: Applets Instructor: J.G. Neal Objectives: To gain experience with: 1. Programming Java applets and the HTML page within which an applet is embedded. 2. The passing of parameters

More information

CS 2340 Objects and Design

CS 2340 Objects and Design CS 2340 Objects and Design Structural Patterns Christopher Simpkins chris.simpkins@gatech.edu Chris Simpkins (Georgia Tech) CS 2340 Objects and Design Structural Patterns 1 / 10 Structural Design Patterns

More information

Custom Data Models and Cell Renderers

Custom Data Models and Cell Renderers 2010 Marty Hall Advanced Swing & MVC Custom Data Models and Cell Renderers Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/java5.html 2 Customized Java

More information

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming

More information

Basics of programming 3. Java GUI and SWING

Basics of programming 3. Java GUI and SWING Basics of programming 3 Java GUI and SWING Complex widgets Basics of programming 3 BME IIT, Goldschmidt Balázs 2 Complex widgets JList elements can be selected from a list JComboBox drop down list with

More information

Cork Institute of Technology. Spring 2006 GUI/Mobile/Web (Time: 3 Hours)

Cork Institute of Technology. Spring 2006 GUI/Mobile/Web (Time: 3 Hours) Cork Institute of Technology Bachelor of Science (Honours) in Software Development Stage 3 (NFQ Level 8) Spring 2006 GUI/Mobile/Web (Time: 3 Hours) Answer FOUR questions ONLY. Show all work. Marks:All

More information

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling

Frames, GUI and events. Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Frames, GUI and events Introduction to Swing Structure of Frame based applications Graphical User Interface (GUI) Events and event handling Introduction to Swing The Java AWT (Abstract Window Toolkit)

More information

Probing Questions. Chapter Accessor Methods

Probing Questions. Chapter Accessor Methods Chapter 3 Probing Questions In the preceding chapter, we learned how to give commands in Java. Using method invocations, you can now write programs that create GUI components and then command them to change

More information

CSE 331. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 331. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 331 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

Block I Unit 2. Basic Constructs in Java. AOU Beirut Computer Science M301 Block I, unit 2 1

Block I Unit 2. Basic Constructs in Java. AOU Beirut Computer Science M301 Block I, unit 2 1 Block I Unit 2 Basic Constructs in Java M301 Block I, unit 2 1 Developing a Simple Java Program Objectives: Create a simple object using a constructor. Create and display a window frame. Paint a message

More information

Index SELF-STUDY. Symbols

Index SELF-STUDY. Symbols SELF-STUDY 393 Index Symbols -... 239 "Event-to-property"... 144 "Faux" variables... 70 %... 239 ( )... 239 (Pme) paradigm... 14 *... 239 +... 239 /... 239 =... 239 = Null... 46 A A project... 24-25, 35

More information

2110: GUIS: Graphical User Interfaces

2110: GUIS: Graphical User Interfaces 2110: GUIS: Graphical User Interfaces Their mouse had a mean time between failure of a week it would jam up irreparably, or... jam up on the table--... It had a flimsy cord whose wires would break. Steve

More information

CoSc Lab # 5 (The Controller)

CoSc Lab # 5 (The Controller) CoSc 10403 Lab # 5 (The Controller) Due Date: Part I, Experiment classtime, Thursday, Oct 25 th, 2018. Part II, Program - by midnight, Thursday, Oct 25 th, 2018. Part I MUST be typed and submitted to your

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal

CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal Objectives: To gain experience with the programming of: 1. Graphical user interfaces (GUIs), 2. GUI components, and 3. Event handling (required

More information

BASICS OF OBJECT ORIENTED PROGRAMMING

BASICS OF OBJECT ORIENTED PROGRAMMING 4 CHAPTER Learning Objectives BASICS OF OBJECT ORIENTED PROGRAMMING After studying this lesson the students will be able to: Understand the need of object oriented programming Define the various terms

More information

Chapter 13 Lab Advanced GUI Applications

Chapter 13 Lab Advanced GUI Applications Gaddis_516907_Java 4/10/07 2:10 PM Page 113 Chapter 13 Lab Advanced GUI Applications Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the

More information

A set, collection, group, or configuration containing members regarded as having certain attributes or traits in common.

A set, collection, group, or configuration containing members regarded as having certain attributes or traits in common. Chapter 6 Class Action In Chapter 1, we explained that Java uses the word class to refer to A set, collection, group, or configuration containing members regarded as having certain attributes or traits

More information

Inheritance, and Polymorphism.

Inheritance, and Polymorphism. Inheritance and Polymorphism by Yukong Zhang Object-oriented programming languages are the most widely used modern programming languages. They model programming based on objects which are very close to

More information

Chapter 4. Swing 18 marks

Chapter 4. Swing 18 marks Chapter 4 Swing 18 marks 1) Distinguish Between the Swing and AWT Ans: Swing It uses javax.swing package. It uses JApplet class Swing is light weight component It is Platform independent code Swing Support

More information

CS-140 Fall 2017 Test 1 Version Practice Practice for Nov. 20, Name:

CS-140 Fall 2017 Test 1 Version Practice Practice for Nov. 20, Name: CS-140 Fall 2017 Test 1 Version Practice Practice for Nov. 20, 2017 Name: 1. (10 points) For the following, Check T if the statement is true, the F if the statement is false. (a) T F : If a child overrides

More information

Window Interfaces Using Swing Objects

Window Interfaces Using Swing Objects Chapter 12 Window Interfaces Using Swing Objects Event-Driven Programming and GUIs Swing Basics and a Simple Demo Program Layout Managers Buttons and Action Listeners Container Classes Text I/O for GUIs

More information

Tool Kits, Swing. Overview. SMD158 Interactive Systems Spring Tool Kits in the Abstract. An overview of Swing/AWT

Tool Kits, Swing. Overview. SMD158 Interactive Systems Spring Tool Kits in the Abstract. An overview of Swing/AWT INSTITUTIONEN FÖR Tool Kits, Swing SMD158 Interactive Systems Spring 2005 Jan-28-05 2002-2005 by David A. Carr 1 L Overview Tool kits in the abstract An overview of Swing/AWT Jan-28-05 2002-2005 by David

More information

Graphical interfaces & event-driven programming

Graphical interfaces & event-driven programming Graphical interfaces & event-driven programming Lecture 12 of TDA 540 (Objektorienterad Programmering) Carlo A. Furia Alex Gerdes Chalmers University of Technology Gothenburg University Fall 2017 Pop quiz!

More information

CSE 331. Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CSE 331. Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 331 Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT Lecturer: Michael Hotan slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer,

More information

Unit 6: Graphical User Interface

Unit 6: Graphical User Interface Faculty of Computer Science Programming Language 2 Object oriented design using JAVA Dr. Ayman Ezzat Email: ayman@fcih.net Web: www.fcih.net/ayman Unit 6: Graphical User Interface 1 1. Overview of the

More information

More Swing. Chapter 14. Chapter 14 1

More Swing. Chapter 14. Chapter 14 1 More Swing Chapter 14 Chapter 14 1 Objectives learn to add menus, icons, borders, and scroll bars to GUIs learn to use the BoxLayout manager and the Box class learn about inner classes learn about the

More information

AP CS Unit 11: Graphics and Events

AP CS Unit 11: Graphics and Events AP CS Unit 11: Graphics and Events This packet shows how to create programs with a graphical interface in a way that is consistent with the approach used in the Elevens program. Copy the following two

More information

Programming Project: Game of Life

Programming Project: Game of Life Programming Project: Game of Life Collaboration Solo: All work must be your own with optional help from UofA section leaders The Game of Life was invented by John Conway to simulate the birth and death

More information

Topic 7: Algebraic Data Types

Topic 7: Algebraic Data Types Topic 7: Algebraic Data Types 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 5.5, 5.7, 5.8, 5.10, 5.11, 5.12, 5.14 14.4, 14.5, 14.6 14.9, 14.11,

More information

Swing. By Iqtidar Ali

Swing. By Iqtidar Ali Swing By Iqtidar Ali Background of Swing We have been looking at AWT (Abstract Window ToolKit) components up till now. Programmers were not comfortable when doing programming with AWT. Bcoz AWT is limited

More information

Contents Chapter 1 Introduction to Programming and the Java Language

Contents Chapter 1 Introduction to Programming and the Java Language Chapter 1 Introduction to Programming and the Java Language 1.1 Basic Computer Concepts 5 1.1.1 Hardware 5 1.1.2 Operating Systems 8 1.1.3 Application Software 9 1.1.4 Computer Networks and the Internet

More information

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1 Java Swing based on slides by: Walter Milner Java Swing Walter Milner 2005: Slide 1 What is Swing? A group of 14 packages to do with the UI 451 classes as at 1.4 (!) Part of JFC Java Foundation Classes

More information

1. Position your mouse over the column line in the column heading so that the white cross becomes a double arrow.

1. Position your mouse over the column line in the column heading so that the white cross becomes a double arrow. Excel 2010 Modifying Columns, Rows, and Cells Introduction Page 1 When you open a new, blank workbook, the cells are set to a default size.you do have the ability to modify cells, and to insert and delete

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) Layout Managment 1 Hello World Often have a static method: createandshowgui() Invoked by main calling invokelater private static void createandshowgui() { } JFrame frame

More information

Object-Oriented Programming Design. Topic : User Interface Components with Swing GUI Part III

Object-Oriented Programming Design. Topic : User Interface Components with Swing GUI Part III Electrical and Computer Engineering Object-Oriented Topic : User Interface Components with Swing GUI Part III Maj Joel Young Joel.Young@afit.edu 17-Sep-03 Maj Joel Young Creating GUI Apps The Process Overview

More information

Chapter 8 Objects and Classes

Chapter 8 Objects and Classes Chapter 8 Objects and Classes 1 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections, loops, methods, and arrays. However, these Java

More information

Implementing Graphical User Interfaces

Implementing Graphical User Interfaces Chapter 6 Implementing Graphical User Interfaces 6.1 Introduction To see aggregation and inheritance in action, we implement a graphical user interface (GUI for short). This chapter is not about GUIs,

More information

Project MineSweeper Collaboration: Solo Complete this Project by yourself or with help from Section Leaders and Rick You are asked to write the non-graphical user interface aspects of the popular game

More information

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus

Chapter 13 Lab Advanced GUI Applications Lab Objectives. Introduction. Task #1 Creating a Menu with Submenus Chapter 13 Lab Advanced GUI Applications Lab Objectives Be able to add a menu to the menu bar Be able to use nested menus Be able to add scroll bars, giving the user the option of when they will be seen.

More information

1. Write code to answer each of the following questions. For this question, it is not necessary for you to define constants or write comments.

1. Write code to answer each of the following questions. For this question, it is not necessary for you to define constants or write comments. 1. Write code to answer each of the following questions. For this question, it is not necessary for you to define constants or write comments. a. (5 points) Declare an instance variable to hold an array

More information

Dr. Hikmat A. M. AbdelJaber

Dr. Hikmat A. M. AbdelJaber Dr. Hikmat A. M. AbdelJaber GUI are event driven (i.e. when user interacts with a GUI component, the interaction (event) derives the program to perform a task). Event: click button, type in text field,

More information

CompSci 125 Lecture 17. GUI: Graphics, Check Boxes, Radio Buttons

CompSci 125 Lecture 17. GUI: Graphics, Check Boxes, Radio Buttons CompSci 125 Lecture 17 GUI: Graphics, Check Boxes, Radio Buttons Announcements GUI Review Review: Inheritance Subclass is a Parent class Includes parent s features May Extend May Modify extends! Parent

More information

Graphical User Interfaces in Java - SWING

Graphical User Interfaces in Java - SWING Graphical User Interfaces in Java - SWING Graphical User Interfaces (GUI) Each graphical component that the user can see on the screen corresponds to an object of a class Component: Window Button Menu...

More information

First Name: AITI 2004: Exam 2 July 19, 2004

First Name: AITI 2004: Exam 2 July 19, 2004 First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: Standard Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand

More information

Lecture 6: Components. CS480: Graphical User Interfaces. Dario Salvucci, Drexel University.

Lecture 6: Components. CS480: Graphical User Interfaces. Dario Salvucci, Drexel University. Lecture 6: Components CS480: Graphical User Interfaces. Dario Salvucci, Drexel University. 1 Widget Week! Look at the most common GUI components see what they do see how they work High-level goal: Get

More information

Graphical User Interfaces. Swing. Jose Jesus García Rueda

Graphical User Interfaces. Swing. Jose Jesus García Rueda Graphical User Interfaces. Swing Jose Jesus García Rueda Introduction What are the GUIs? Well known examples Basic concepts Graphical application. Containers. Actions. Events. Graphical elements: Menu

More information

Chapter 8 Objects and Classes Part 1

Chapter 8 Objects and Classes Part 1 Chapter 8 Objects and Classes Part 1 1 OO Programming Concepts Object-oriented programming (OOP) involves programming using objects. An object represents an entity in the real world that can be distinctly

More information

Graphical User Interface

Graphical User Interface Lecture 10 Graphical User Interface An introduction Sahand Sadjadee sahand.sadjadee@liu.se Programming Fundamentals 725G61 http://www.ida.liu.se/~725g61/ Department of Computer and Information Science

More information

Constants are named in ALL_CAPS, using upper case letters and underscores in their names.

Constants are named in ALL_CAPS, using upper case letters and underscores in their names. Naming conventions in Java The method signature Invoking methods All class names are capitalized Variable names and method names start with a lower case letter, but every word in the name after the first

More information

CMSC 150 Lab 8, Part II: Little PhotoShop of Horrors, Part Deux 10 Nov 2015

CMSC 150 Lab 8, Part II: Little PhotoShop of Horrors, Part Deux 10 Nov 2015 CMSC 150 Lab 8, Part II: Little PhotoShop of Horrors, Part Deux 10 Nov 2015 By now you should have completed the Open/Save/Quit portion of the menu options. Today we are going to finish implementing the

More information

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM

CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM CS 315 Software Design Homework 1 First Sip of Java Due: Sept. 10, 11:30 PM Objectives The objectives of this assignment are: to get your first experience with Java to become familiar with Eclipse Java

More information

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming GUI Design Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu /~spring Overview of Part 1 of the Course Demystifying

More information

Dr. Hikmat A. M. AbdelJaber

Dr. Hikmat A. M. AbdelJaber Dr. Hikmat A. M. AbdelJaber JWindow: is a window without a title bar or move controls. The program can move and resize it, but the user cannot. It has no border at all. It optionally has a parent JFrame.

More information

Course Status Networking GUI Wrap-up. CS Java. Introduction to Java. Andy Mroczkowski

Course Status Networking GUI Wrap-up. CS Java. Introduction to Java. Andy Mroczkowski CS 190 - Java Introduction to Java Andy Mroczkowski uamroczk@cs.drexel.edu Department of Computer Science Drexel University March 10, 2008 / Lecture 8 Outline Course Status Course Information & Schedule

More information

Packages: Putting Classes Together

Packages: Putting Classes Together Packages: Putting Classes Together 1 Introduction 2 The main feature of OOP is its ability to support the reuse of code: Extending the classes (via inheritance) Extending interfaces The features in basic

More information

Chapter 12 GUI Basics

Chapter 12 GUI Basics Chapter 12 GUI Basics 1 Creating GUI Objects // Create a button with text OK JButton jbtok = new JButton("OK"); // Create a label with text "Enter your name: " JLabel jlblname = new JLabel("Enter your

More information

CSC 161 SPRING 17 LAB 2-1 BORDERLAYOUT, GRIDLAYOUT, AND EVENT HANDLING

CSC 161 SPRING 17 LAB 2-1 BORDERLAYOUT, GRIDLAYOUT, AND EVENT HANDLING CSC 161 SPRING 17 LAB 2-1 BORDERLAYOUT, GRIDLAYOUT, AND EVENT HANDLING PROFESSOR GODFREY MUGANDA 1. Learn to Generate Random Numbers The class Random in Java can be used to create objects of the class

More information

First Name: AITI 2004: Exam 2 July 19, 2004

First Name: AITI 2004: Exam 2 July 19, 2004 First Name: AITI 2004: Exam 2 July 19, 2004 Last Name: JSP Track Read Instructions Carefully! This is a 3 hour closed book exam. No calculators are allowed. Please write clearly if we cannot understand

More information

Display, Overflow, White Space, and Cursor Karl Kasischke WCC INP 150 Winter

Display, Overflow, White Space, and Cursor Karl Kasischke WCC INP 150 Winter Display, Overflow, White Space, and Cursor 2009 Karl Kasischke WCC INP 150 Winter 2009 1 display Property overflow Property Minimum and Maximum Widths and Heights white-space Property cursor Property 2009

More information

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming

CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming CPS122 Lecture: Graphical User Interfaces and Event-Driven Programming Objectives: Last revised 1/15/10 1. To introduce the notion of a component and some basic Swing components (JLabel, JTextField, JTextArea,

More information

CoSc Lab # 6 (The Model) Due Date: Part I, Experiment classtime, Tuesday, Nov 6 th, 2018.

CoSc Lab # 6 (The Model) Due Date: Part I, Experiment classtime, Tuesday, Nov 6 th, 2018. CoSc 10403 Lab # 6 (The Model) Due Date: Part I, Experiment classtime, Tuesday, Nov 6 th, 2018. Part II, Program - by midnight, Tuesday, Nov 6 th, 2018. Again you will be required to "zip" together the

More information

CSC324 Principles of Programming Languages

CSC324 Principles of Programming Languages CSC324 Principles of Programming Languages http://mcs.utm.utoronto.ca/~324 November 21, 2018 Last Class Types terminology Haskell s type system Currying Defining types Value constructors Algebraic data

More information

Administrivia. CSSS Movie Night: Zombieland & Iron Man Date: Thurs., Mar 11 Time: 6 10 pm Location: DMP 310 Free pop & popcorn for every attendee!

Administrivia. CSSS Movie Night: Zombieland & Iron Man Date: Thurs., Mar 11 Time: 6 10 pm Location: DMP 310 Free pop & popcorn for every attendee! Department of Computer Science Undergraduate Events Events this week Drop-In Resume and Cover Letter Editing (20 min. appointments) Date: Thurs., March 11 Time: 11:30 am 2:30 pm Location: Rm 255, ICICS/CS

More information

ENCAPSULATION. private, public, scope and visibility rules. packages and package level access.

ENCAPSULATION. private, public, scope and visibility rules. packages and package level access. ENCAPSULATION private, public, scope and visibility rules. packages and package level access. Q. Explain the term Encapsulation with an example? Ans: The wrapping up to data and methods into a single units

More information

SSJ User s Guide. Package stat Tools for Collecting Statistics. Version: December 21, 2006

SSJ User s Guide. Package stat Tools for Collecting Statistics. Version: December 21, 2006 SSJ User s Guide Package stat Tools for Collecting Statistics Version: December 21, 2006 CONTENTS 1 Contents Overview........................................ 2 StatProbe........................................

More information

Static Detection of Brittle Parameter Typing

Static Detection of Brittle Parameter Typing Static Detection of Brittle Parameter Typing Michael Pradel, Severin Heiniger, and Thomas R. Gross Department of Computer Science ETH Zurich 1 Motivation void m(a a) {... } Object A.. B C D E F 2 Motivation

More information

More Skills 12 Create Web Queries and Clear Hyperlinks

More Skills 12 Create Web Queries and Clear Hyperlinks CHAPTER 9 Excel More Skills 12 Create Web Queries and Clear Hyperlinks Web queries are requests that are sent to web pages to retrieve and display data in Excel workbooks. Web queries work best when retrieving

More information

PIC 20A GUI with swing

PIC 20A GUI with swing PIC 20A GUI with swing Ernest Ryu UCLA Mathematics Last edited: November 22, 2017 Hello swing Let s create a JFrame. import javax. swing.*; public class Test { public static void main ( String [] args

More information

Programming Languages 2nd edition Tucker and Noonan"

Programming Languages 2nd edition Tucker and Noonan Programming Languages 2nd edition Tucker and Noonan" Chapter 16 Event-Driven Programming Of all men s miseries the bitterest is this, to know so much and to have control over nothing." " " " " " " "Herodotus

More information