Assignment #3 (Due 4/4/2017)
|
|
- Margery Higgins
- 6 years ago
- Views:
Transcription
1 Assignment #3 (Due 4/4/2017) As a follow up to Assignment #2, modify the CheckingAccount class to add the following instance members: an array (self-expanding type) or ArrayList of Transaction objects and a int variable transcount (incremented each time a new Transaction object is created). Create a Transaction class that stores an int transnumber (will be the current value of transcount), an int transid (1 = check, 2 = deposit 3 = service charge) and a double transamt. Prompt the user for the choice of a) entering a transaction, b) listing all transations, c) listing all checks, d) listing all deposits.(implement these options with JFrame,JLabel, JRadioButton, ButtonGroup, and a listener) The listings must go to a Dialog box. Add instance methods to the CheckingAccount class like addtrans (put a trans into the account), gettrans (get a transaction from the array) gettranscount(get the current value of transcount class variable) and any other methods you wish to implement. This program is event-driven. You cannot put all the processing steps/logic in main. You can put them in helper methods in the Main class, in the GUI objects class, or in the CheckingAccount class, so they can be called by the listener method. Suggested Reading in Textbook: Chapter , , , , Sample Run Download Assignment3SampleRun.pdf from the class website. Code Template The following code template will help with this assignment: New data and methods for the CheckingAccount Class private ArrayList<Transaction> translist; // keeps a list of Transaction objects for the account private int transcount; // the count of Transaction objects and used as the ID for each transaction public void addtrans( Transaction newtrans) // adds a transaction object to the translist public int gettranscount() //returns the current value of transcount; public Transaction gettrans(int i) // returns the i-th Transaction object in the list 1
2 New Transaction class public class Transaction private int transnumber; private int transid; private double transamt; public Transaction(int number, int id, double amount) transnumber = number; transid = id; transamt = amount; public int gettransnumber() return transnumber; public int gettransid() return transid; public double gettransamount() return transamt; Sample Code //******************************************************************** // EOptionsPanel.java Author: // Demonstrates the use of radio buttons to capture input options. // and listener to call methods to process the options //******************************************************************** import javax.swing.*; 2
3 import java.awt.*; import java.awt.event.*; public class EOptionsPanel extends JPanel private JLabel prompt; private JRadioButton one, two, three; // // Sets up a panel with a label and a set of radio buttons // that present options to the user. // public EOptionsPanel() prompt = new JLabel ("Choose your input option?"); prompt.setfont (new Font ("Helvetica", Font.BOLD, 24)); one = new JRadioButton ("input element"); one.setbackground (Color.green); two = new JRadioButton ("list all elements"); two.setbackground (Color.green); three = new JRadioButton ("show element count"); three.setbackground (Color.green); ButtonGroup group = new ButtonGroup(); group.add (one); group.add (two); group.add (three); EOptionListener listener = new EOptionListener(); one.addactionlistener (listener); two.addactionlistener (listener); three.addactionlistener (listener); // add the components to the JPanel add (prompt); add (one); add (two); add (three); 3
4 setbackground (Color.green); setpreferredsize (new Dimension(400, 100)); //***************************************************************** // Represents the listener for the radio buttons //***************************************************************** private class EOptionListener implements ActionListener // // Calls the method to process the option for which radio // button was pressed. // public void actionperformed (ActionEvent event) Object source = event.getsource(); if (source == one) MyElements2.inputElements(); else if (source == two) MyElements2.listElements(); else String message; message = "The number of elements processed was "+ ChemicalElement.getNumOfElements(); JOptionPane.showMessageDialog (null, message); // MyElements2 Author: // Demonstrates the use of radio buttons with listener // and multiple dialog boxes for user interaction. // Demonstrates the use of the JOptionPane class. 4
5 import javax.swing.joptionpane; import javax.swing.jframe; public class MyElements2 public static JFrame frame; public static ChemicalElement[] elist; public static void main (String[] args) elist = new ChemicalElement[10]; String message; frame = new JFrame ("Chemical Elements Options"); frame.setdefaultcloseoperation (JFrame.EXIT_ON_CLOSE); EOptionsPanel panel = new EOptionsPanel(); frame.getcontentpane().add (panel); frame.pack(); frame.setvisible(true); public static void listelements() String message, ntabs; int num; System.out.println("\nNumber"+"\t"+"Name"+"\t\t"+"Symbol"+"\t" +"AtomicNumber"+"\n"); for ( num=0; num < ChemicalElement.getNumOfElements();num++) if (elist[num].getname().length() < 8) ntabs="\t\t"; else ntabs="\t"; message = num + "\t"+elist[num].getname()+ntabs+elist[num].getsymbol()+ "\t"+elist[num].getnumber(); System.out.println(message); 5
6 public static void inputelements() String name, symbol, numstr, message; int number, again, index; frame.setvisible(false); do name = JOptionPane.showInputDialog ("Enter the Element name: "); symbol = JOptionPane.showInputDialog ("Enter the Element symbol: "); numstr = JOptionPane.showInputDialog ("Enter the Element number: "); number = Integer.parseInt(numStr); index = ChemicalElement.getNumOfElements(); elist[index] = new ChemicalElement(name,symbol,number); message = elist[index].tostring(); JOptionPane.showMessageDialog (null, message); again = JOptionPane.showConfirmDialog (null, "Input Another?"); while (again == JOptionPane.YES_OPTION); frame.setvisible(true); // Method added to ChemicalElement class public String tostring() String message; message = "The element name is "+nameofelement+"\n" + "Its atomic symbol is "+chemicalsymbol+"\n" + "Its atomic number is "+atomicnumber; return message; 6
Adding Buttons to StyleOptions.java
Adding Buttons to StyleOptions.java The files StyleOptions.java and StyleOptionsPanel.java are from Listings 5.14 and 5.15 of the text (with a couple of slight changes an instance variable fontsize is
More informationimport javax.swing.jframe; import javax.swing.joptionpane;
EvenOdd.java Printed: 11/8/17, 6:56:33 AM Page 1/1 PushCounter.java Printed: 11/8/17, 7:10:01 AM Page 1/1 //******************************************************************** // EvenOdd.java Java Foundations
More informationName: Checked: Learn about listeners, events, and simple animation for interactive graphical user interfaces.
Lab 15 Name: Checked: Objectives: Learn about listeners, events, and simple animation for interactive graphical user interfaces. Files: http://www.csc.villanova.edu/~map/1051/chap04/smilingface.java http://www.csc.villanova.edu/~map/1051/chap04/smilingfacepanel.java
More informationInterfaces & Polymorphism part 2: Collections, Comparators, and More fun with Java graphics
Interfaces & Polymorphism part 2: Collections, Comparators, and More fun with Java graphics 1 Collections (from the Java tutorial)* A collection (sometimes called a container) is simply an object that
More informationWhat Is an Event? Some event handler. ActionEvent. actionperformed(actionevent e) { }
CBOP3203 What Is an Event? Events Objects that describe what happened Event Sources The generator of an event Event Handlers A method that receives an event object, deciphers it, and processes the user
More informationCSIS 10A Assignment 7 SOLUTIONS
CSIS 10A Assignment 7 SOLUTIONS Read: Chapter 7 Choose and complete any 10 points from the problems below, which are all included in the download file on the website. Use BlueJ to complete the assignment,
More informationMIT AITI Swing Event Model Lecture 17
MIT AITI 2004 Swing Event Model Lecture 17 The Java Event Model In the last lecture, we learned how to construct a GUI to present information to the user. But how do GUIs interact with users? How do applications
More informationChapter 4 Writing Classes
Chapter 4 Writing Classes Java Software Solutions Foundations of Program Design Seventh Edition John Lewis William Loftus Writing Classes We've been using predefined classes from the Java API. Now we will
More informationArray indexing. Before we use an array, we have to declare it. For example, int[] height=new int[11];
Chapter 6 Arrays We want to organize objects or primitive data in a form that is easy to access and modify data. We will explore more about the ways to group and organize data in a later chapter, and even
More informationSelection and Repetition Revisited
Selection and Repetition Revisited CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/
More informationAP 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 information1005ICT Object Oriented Programming Lecture Notes
1005ICT Object Oriented Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 2, 2015 1 20 GUI Components and Events This section develops a program
More informationChapter. We've been using predefined classes. Now we will learn to write our own classes to define objects
Writing Classes 4 Chapter 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design 2007 Pearson Addison-Wesley. All rights reserved Writing Classes We've been using predefined
More informationChapter 11: Exceptions Lab Exercises
Chapter 11: Exceptions Lab Exercises Topics Exceptions File Input and Output Mnemonics Tooltips Disabling Buttons Combo Boxes Scroll Panes Lab Exercises Exceptions Aren t Always Errors Placing Exception
More informationSINGLE EVENT HANDLING
SINGLE EVENT HANDLING Event handling is the process of responding to asynchronous events as they occur during the program run. An event is an action that occurs externally to your program and to which
More informationPROGRAMMING 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 informationJava Programming Lecture 6
Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components
More informationCompSci 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 informationStarting Out with Java: From Control Structures Through Objects Sixth Edition
Starting Out with Java: From Control Structures Through Objects Sixth Edition Chapter 12 A First Look at GUI Applications Chapter Topics 12.1 Introduction 12.2 Creating Windows 12.3 Equipping GUI Classes
More informationHomework 6 part 2: Turtle Etch-A-Sketch (40pts)
Homework 6 part 2: Turtle Etch-A-Sketch (40pts) DUE DATE: Friday March 28, 7pm with 5 hour grace period Now that you have done part 1 of Homework 6, Train Your Turtle to Draw on Command, you are ready
More informationUniversity of Cape Town Department of Computer Science. Computer Science CSC117F Solutions
University of Cape Town Department of Computer Science Computer Science CSC117F Solutions Class Test 4 Wednesday 14 May 2003 Marks: 40 Approximate marks per question are shown in brackets Time: 40 minutes
More informationHandout 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 informationSwing/GUI Cheat Sheet
General reminders To display a Swing component, you must: Swing/GUI Cheat Sheet Construct and initialize the component. Example: button = new JButton ("ButtonLabel"); Add it to the content pane of the
More informationJRadioButton account_type_radio_button2 = new JRadioButton("Current"); ButtonGroup account_type_button_group = new ButtonGroup();
Q)Write a program to design an interface containing fields User ID, Password and Account type, and buttons login, cancel, edit by mixing border layout and flow layout. Add events handling to the button
More informationBuilding Graphical User Interfaces. GUI Principles
Building Graphical User Interfaces 4.1 GUI Principles Components: GUI building blocks Buttons, menus, sliders, etc. Layout: arranging components to form a usable GUI Using layout managers. Events: reacting
More informationBuilding Java Programs Bonus Slides
Building Java Programs Bonus Slides Graphical User Interfaces Copyright (c) Pearson 2013. All rights reserved. Graphical input and output with JOptionPane JOptionPane An option pane is a simple dialog
More informationBuilding Graphical User Interfaces. Overview
Building Graphical User Interfaces 4.1 Overview Constructing GUIs Interface components GUI layout Event handling 2 1 GUI Principles Components: GUI building blocks. Buttons, menus, sliders, etc. Layout:
More informationPart I: Learn Common Graphics Components
OOP GUI Components and Event Handling Page 1 Objectives 1. Practice creating and using graphical components. 2. Practice adding Event Listeners to handle the events and do something. 3. Learn how to connect
More informationObject-Oriented Programming in Java
CSCI/CMPE 3326 Object-Oriented Programming in Java 1. GUI 2. Dialog box Dongchul Kim Department of Computer Science University of Texas Rio Grande Valley Introduction to GUI Many Java application use a
More informationGraphic User Interfaces. - GUI concepts - Swing - AWT
Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations
More informationANSWER KEY Exam 2 Computer Programming 230 Dr. St. John Lehman College City University of New York Thursday, 5 November 2009
ANSWER KEY Exam 2 Computer Programming 230 Dr. St. John Lehman College City University of New York Thursday, 5 November 2009 1. True or False: (a) T In Alice, there is an event that is processed as long
More informationGraphical 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 informationGraphical Applications
Graphical Applications The example programs we've explored thus far have been text-based They are called command-line applications, which interact with the user using simple text prompts Let's examine
More informationTopic 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 informationTopic 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 informationDesigning Classes. Where do objects come from? Where do objects come from? Example: Account datatype. Dr. Papalaskari 1
Designing Classes Where do objects come from? CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/
More informationMore about JOptionPane Dialog Boxes
APPENDIX K More about JOptionPane Dialog Boxes In Chapter 2 you learned how to use the JOptionPane class to display message dialog boxes and input dialog boxes. This appendix provides a more detailed discussion
More informationCSC 1051 Data Structures and Algorithms I. Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University
Events and Listeners CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/ Some slides
More informationGraphical User Interfaces
Graphical User Interfaces CSCI 136: Fundamentals CSCI 136: Fundamentals of Computer of Science Computer II Science Keith II Vertanen Keith Vertanen Copyright 2011 Overview Command line versus GUI apps
More informationChapter 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 informationG51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread
G51PGP Programming Paradigms Lecture 008 Inner classes, anonymous classes, Swing worker thread 1 Reminder subtype polymorphism public class TestAnimals public static void main(string[] args) Animal[] animals
More informationAdvanced Java Programming. Swing. Introduction to Swing. Swing libraries. Eran Werner, Tel-Aviv University Summer, 2005
Advanced Java Programming Swing Eran Werner, Tel-Aviv University Summer, 2005 19 May 2005 Advanced Java Programming, Summer 2005 1 Introduction to Swing The Swing package is part of the Java Foundation
More informationSelection and Repetition
Selection and Repetition Revisited CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/
More informationAttempt FOUR questions Marking Scheme Time: 120 mins
Ahmadu Bello University Department of Computer Science Second Semester Examinations August 2017 COSC212: Object Oriented Programming II Marking Scheme Attempt FOUR questions Marking Scheme Time: 120 mins
More informationThe 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 informationState Application Using MVC
State Application Using MVC 1. Getting ed: Stories and GUI Sketch This example illustrates how applications can be thought of as passing through different states. The code given shows a very useful way
More information14.2 Java s New Nimbus Look-and-Feel 551 Sample GUI: The SwingSet3 Demo Application As an example of a GUI, consider Fig. 14.1, which shows the SwingS
550 Chapter 14 GUI Components: Part 1 14.1 Introduction 14.2 Java s New Nimbus Look-and-Feel 14.3 Simple GUI-Based Input/Output with JOptionPane 14.4 Overview of Swing Components 14.5 Displaying Text and
More informationCopyright 1999 by Deitel & Associates, Inc. All Rights Reserved.
CHAPTER 2 1 2 1 // Fig. 2.1: Welcome1.java 2 // A first program in Java 3 4 public class Welcome1 { 5 public static void main( String args[] ) 6 { 7 System.out.println( "Welcome to Java Programming!" );
More informationCS 209 Programming in Java #10 Exception Handling
CS 209 Programming in Java #10 Exception Handling Textbook Chapter 15 Spring, 2006 Instructor: J.G. Neal 1 Topics What is an Exception? Exception Handling Fundamentals Errors and Exceptions The try-catch-finally
More informationSTRUKTUR PROGRAM JAVA: //Daftar paket yang digunakan dalam program import namapaket;
STRUKTUR PROGRAM JAVA: //Daftar paket yang digunakan dalam program import namapaket; //Membuat Kelas public class namakelas //Metode Utama public static void main(string[] args) perintah-perintah;... LATIHAN
More informationOverview. Building Graphical User Interfaces. GUI Principles. AWT and Swing. Constructing GUIs Interface components GUI layout Event handling
Overview Building Graphical User Interfaces Constructing GUIs Interface components GUI layout Event handling 4.1 GUI Principles AWT and Swing Components: GUI building blocks. Buttons, menus, sliders, etc.
More informationJLayeredPane. Depth Constants in JLayeredPane
JLayeredPane Continuing on Swing Components A layered pane is a Swing container that provides a third dimension for positioning components depth or Z order. The class for the layered pane is JLayeredPane.
More informationCalculator Class. /** * Create a new calculator and show it. */ public Calculator() { engine = new CalcEngine(); gui = new UserInterface(engine); }
A Calculator Project This will be our first exposure to building a Graphical User Interface (GUI) in Java The functions of the calculator are self-evident The Calculator class creates a UserInterface Class
More informationDesigning Classes Part 2
Designing Classes Part 2 CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/ Graphical
More informationCS180 Spring 2010 Exam 2 Solutions, 29 March, 2010 Prof. Chris Clifton
CS180 Spring 2010 Exam 2 Solutions, 29 March, 2010 Prof. Chris Clifton Turn Off Your Cell Phone. Use of any electronic device during the test is prohibited. Time will be tight. If you spend more than the
More informationUser interfaces and Swing
User interfaces and Swing Overview, applets, drawing, action listening, layout managers. APIs: java.awt.*, javax.swing.*, classes names start with a J. Java Lectures 1 2 Applets public class Simple extends
More informationH212 Introduction to Software Systems Honors
Introduction to Software Systems Honors Lecture #19: November 4, 2015 1/14 Third Exam The third, Checkpoint Exam, will be on: Wednesday, November 11, 2:30 to 3:45 pm You will have 3 questions, out of 9,
More informationProject 1. LibraryTest.java. Yuji Shimojo CMSC 335
Project 1 LibraryTest.java Yuji Shimojo CMSC 335 April 1, 2012 1 Contents 1. Programs... 3 2. Execution Result... 10 3. Class Diagram... 11 4. Operating Instructions & Test Cases... 11 5. Test Data...
More informationCSE 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 informationOutline. 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 informationGoals. 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 informationGUI Basics. Object Orientated Programming in Java. Benjamin Kenwright
GUI Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Graphical User Interface (GUI) Concepts Libraries, Implementation, Mechanics,.. Abstract Windowing Toolkit (AWT) Java
More informationSystems Programming Graphical User Interfaces
Systems Programming Graphical User Interfaces Julio Villena Román (LECTURER) CONTENTS ARE MOSTLY BASED ON THE WORK BY: José Jesús García Rueda Systems Programming GUIs based on Java
More informationGraphics. Lecture 18 COP 3252 Summer June 6, 2017
Graphics Lecture 18 COP 3252 Summer 2017 June 6, 2017 Graphics classes In the original version of Java, graphics components were in the AWT library (Abstract Windows Toolkit) Was okay for developing simple
More informationBuilding a GUI in Java with Swing. CITS1001 extension notes Rachel Cardell-Oliver
Building a GUI in Java with Swing CITS1001 extension notes Rachel Cardell-Oliver Lecture Outline 1. Swing components 2. Building a GUI 3. Animating the GUI 2 Swing A collection of classes of GUI components
More informationWe are on the GUI fast track path
We are on the GUI fast track path Chapter 13: Exception Handling Skip for now Chapter 14: Abstract Classes and Interfaces Sections 1 9: ActionListener interface Chapter 15: Graphics Skip for now Chapter
More informationArrays, Exception Handling, Interfaces, Introduction To Swing
Arrays, Exception Handling, Interfaces, Introduction To Swing Arrays: Definition An array is an ordered collection of items; an item in an array is called an element of the array. By item we mean a primitive,
More informationLayouts and Components Exam
Layouts and Components Exam Name Period A. Vocabulary: Answer each question specifically, based on what was taught in class. Term Question Answer JScrollBar(a, b, c, d, e) Describe c. ChangeEvent What
More informationFrames, 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 informationControl Statements: Part Pearson Education, Inc. All rights reserved.
1 5 Control Statements: Part 2 5.2 Essentials of Counter-Controlled Repetition 2 Counter-controlled repetition requires: Control variable (loop counter) Initial value of the control variable Increment/decrement
More informationExample: not good design. Motivation for MVC. public class BankAccount extends JPanel implements ActionListener
References: Teach Yourself Programming in 21 Days, Anthony Sintes; Rick Mercer;Beginning Java Objects, Jacquie Barker; 3/2/2004 1 Motivation for MVC Decoupled UIs are good One model may have several user
More informationIntroduction. Introduction
Introduction Many Java application use a graphical user interface or GUI (pronounced gooey ). A GUI is a graphical window or windows that provide interaction with the user. GUI s accept input from: the
More informationProgramming 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 informationAn array is a type of variable that is able to hold more than one piece of information under a single variable name.
Arrays An array is a type of variable that is able to hold more than one piece of information under a single variable name. Basically you are sub-dividing a memory box into many numbered slots that can
More informationPart 3: Graphical User Interface (GUI) & Java Applets
1,QWURGXFWLRQWR-DYD3URJUDPPLQJ (( Part 3: Graphical User Interface (GUI) & Java Applets EE905-GUI 7RSLFV Creating a Window Panels Event Handling Swing GUI Components ƒ Layout Management ƒ Text Field ƒ
More informationClient-side GUI. A simple Swing-gui for searching for proudcts
Client-side GUI A simple Swing-gui for searching for proudcts Working from a sketch to a rough GUI We make a list of the features / requirements We ll then start with a sketch of how a GUI for searching
More informationDatenbank-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 informationProgramming 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 informationChapter 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 informationPackages: 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 informationChapter 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 informationQueens College, CUNY Department of Computer Science. CS 212 Object-Oriented Programming in Java Practice Exam 2. CS 212 Exam 2 Study Guide
Topics for Exam 2: Queens College, CUNY Department of Computer Science CS 212 Object-Oriented Programming in Java Practice Exam 2 CS 212 Exam 2 Study Guide Linked Lists define a list node define a singly-linked
More informationGraphical User Interface (GUI) and Object- Oriented Design (OOD)
Chapter 6,13 Graphical User Interface (GUI) and Object- Oriented Design (OOD) Objectives To distinguish simple GUI components. To describe the Java GUI API hierarchy. To create user interfaces using frames,
More informationCSE 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 informationProctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.
SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:
More informationSwing Programming Example Number 2
1 Swing Programming Example Number 2 Problem Statement (Part 1 and 2 (H/w- assignment) 2 Demonstrate the use of swing Label, TextField, RadioButton, CheckBox, Listbox,Combo Box, Toggle button,image Icon
More informationDM503 Programming B. Peter Schneider-Kamp.
DM503 Programming B Peter Schneider-Kamp petersk@imada.sdu.dk! http://imada.sdu.dk/~petersk/dm503/! ADVANCED OBJECT-ORIENTATION 2 Object-Oriented Design classes often do not exist in isolation from each
More informationDr. 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 informationIntroduction 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 informationClass 16: The Swing Event Model
Introduction to Computation and Problem Solving Class 16: The Swing Event Model Prof. Steven R. Lerman and Dr. V. Judson Harward 1 The Java Event Model Up until now, we have focused on GUI's to present
More informationGraphical 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 informationJava Interfaces Part 1 - Events Version 1.1
Java Interfaces Part 1 - Events Version 1.1 By Dr. Nicholas Duchon July 22, 2007 Page 1 Overview Philosophy Large Scale Java Language Structures Abstract classes Declarations Extending a abstract classes
More informationExample 3-1. Password Validation
Java Swing Controls 3-33 Example 3-1 Password Validation Start a new empty project in JCreator. Name the project PasswordProject. Add a blank Java file named Password. The idea of this project is to ask
More informationSwing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff
Swing UI by Vlad Costel Ungureanu for Learn Stuff User Interface Command Line Graphical User Interface (GUI) Tactile User Interface (TUI) Multimedia (voice) Intelligent (gesture recognition) 2 Making the
More informationJOptionPane Dialogs. javax.swing.joptionpane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs.
JOptionPane Dialogs javax.swing.joptionpane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs. Easy to create 4 Common Dialogs: Message Dialog - display a message
More informationProgramming Languages and Techniques (CIS120)
Programming Languages and Techniques (CIS120) Lecture 32 April 9, 2018 Swing I: Drawing and Event Handling Chapter 29 HW8: Spellchecker Available on the web site Due: Tuesday! Announcements Parsing, working
More informationProgramming Language Concepts: Lecture 8
Programming Language Concepts: Lecture 8 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 8, 11 February 2009 GUIs and event
More informationSystems Programming. Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid
Systems Programming Bachelor in Telecommunication Technology Engineering Bachelor in Communication System Engineering Carlos III University of Madrid Leganés, 21st of March, 2014. Duration: 75 min. Full
More informationCourse PJL. Arithmetic Operations
Outline Oman College of Management and Technology Course 503200 PJL Handout 5 Arithmetic Operations CS/MIS Department 1 // Fig. 2.9: Addition.java 2 // Addition program that displays the sum of two numbers.
More informationencompass a group of features for building Graphical User Interfaces (GUI).
Java GUI (intro) JFC Java Foundation Classes encompass a group of features for building Graphical User Interfaces (GUI). javax.swing.* used for building GUIs. Some basic functionality is already there
More information