Here are the steps to get the files for this project after logging in on acad/bill.
|
|
- Dorthy Chambers
- 5 years ago
- Views:
Transcription
1 CSC 243, Java Programming, Spring 2013, Dr. Dale Parson Assignment 5, handling events in a working GUI ASSIGNMENT due by 11:59 PM on Thursday May 9 via gmake turnitin Here are the steps to get the files for this project after logging in on acad/bill. cd $HOME/JavaLang cp ~parson/javalang/fillword5.problem.zip FillWord5.problem.zip unzip FillWord5.problem.zip cd./fillword5 I recommend that you should run gmake test immediately. It should pass all tests as handed out. All of your work will go into the GUI class FillWordFrame in file FilleWordFrame.java. You can copy files immediately to your PC or laptop to work after passing gmake test. NOTE: My handout FillWordFrame.java compiles and runs. It is basically my solution to Assignment 4, but with all of my added fields for Assignment 5 already added to class FillWordFrame. If you prefer to use your own FillWordFrame.java from Assignment 4 as your starting point, you are welcome to do so. After copying onto the PC, running buildwindows.bat and runwindows.bat will work as they did for Assignment 4. Also, you can now execute runparsonwindows.bat to execute my compiled solution to Assignment 5 to see how it works as a reference. I will update with my solution to Assignment 5 as soon as I am done grading Assignment 4. When you have finished developing and testing your GUI, please copy FillWordFrame.java and data_do_not_lose_this_file.txt back into FillWord5/ on bill and run gmake test one last time to make sure that nothing has been lost during file transfers. Then run gmake turnitin before the deadline as usual. 1. Screen shots (taken from my Mac, but with similar appearance for Windows or Unix) There are two screen shots on the next page. The first shows the result of running buildwindows.bat and then runwindows.bat on the handout code. It looks like my end point for Assignment 4. The second screen shot below shows what my solution to assignment 5 looks like for runparsonwindows.bat. You can actually run runparsonwindows.bat to see my solution in action. 2. Requirements for Assignment 5 The following features provide the basis for my grading in Assignment 5. Buggy features may earn partial points or no points as my discretion. I will grade all student assignments using the exact same criteria with respect to bugs. 10% Add the new controls seen at the bottom of my GUI. They have the following functionality, but these 10 points are strictly for getting them to appear correctly. Swap word swaps the current word via interaction with the game object. Save and Restore use the filename obtained from the filename JTextField to save and restore game states in files. Seconds to penalty shows the current state of a countdown timer. My timer starts counting at 32 seconds, but only displays the actual seconds (in red) when there are less than 11 seconds remaining. When it hits 0 it deducts a point from the game and restarts the countdown at one half of its previous limit. It continues this process of counting down to 0, deducting a point, and halving the restart countdown time until the starting point reaches 1 second. Then it deducts a point every second until the player makes a legal move. Any legal move resets the process to its initial 32 seconds. Your layout and timing of these features is up to you, but they have to be present in the GUI. 1
2 The non-functioning GUI as handed out in FillWordFrame.java at the start of Assignment 5 My functioning GUI that you can run via runparsonwindows.bat 10% You must make FillWordFrame a subclass of the new interface FillWordEventListener that I have already supplied in file FillWordEventListener.java. I have supplied completed FillWordEvent.java and FillWordEventListener.java. Their listings appear below. In order to implement this interface, FillWordFrame must now define method processgameevent as defined in FillWordEventListener. This is how your GUI receives notification that the state of the game has changed via a valid move. The primary job of processgameevent is to create an update of the display, either directly or via helper methods, so that it is in sync with the current state of the game. Your code must 2
3 update the displayed GUI state to match the game state whenever processgameevent receives a FillWordEvent in order to earn these points. 10% Clicking any of the buttons in the matrix attempts to make a move there by invoking the game s interpret method with an appropriate command String. You need to create an ActionListener-derived concrete class and hook a distinct instance up to each JButton in the grid via addactionlistener to get this feature to work. 10% Any FillWordException thrown by the game object must be caught and display a JOptionpane pop-up message by calling JOptionPane.showMessageDialog(null, message), where message is a String, and you see on the example below. Make sure to use the exception s getmessage() method to get an informative message to display. 10% The undo and redo buttons must invoke the corresponding command in the game with the correct result. These buttons should appear disabled whenever the game returns false for canundo() or canredo(). 10% Swap word must work correctly. 10% The Save and Restore buttons must work correctly. 10% Highlight the most recently played word in Color.RED or in some other significant way. There is a new method declared in IFillWord in support of this feature. The listing of changes to IFillWord appears below. 10% Get the score-deducting countdown Timer object to work as outlined above. It must both affect the score properly at the appropriate time, and it must update the Seconds to penalty JLabel correctly. This gets you 90% of the way to 100% for required features. -10%/+15% The grow board and grow board & word buttons and the JSpinner between them must appear whenever cangrow() returns true and must not be visible when cangrow() returns false. Note that in Assignment 5 cangrow() returns false when the game hits the swaps limit on number of swaps, and 3
4 both this limit and the actual board size can decrease via undo! The board size must match the game size, whether bigger or smaller than the previous state, in order to get these points. This is perhaps the hardest feature to get correct, so I will deduct 10 points maximum for bugs, but award 15 points if it is fully bug free, essentially giving bonus points for a bug-free implementation. Here is an outline of how to change the size of the display board. Assuming that the displayed JButton matrix lives inside of its own JPanel (called PANELOBJ here), start out by removing the JPanel from its surrounding JPanel or JFrame (called SURROUNDINGOBJ in this example) like this: SURROUNDINGOBJ.remove(PANELOBJ); At that point both PANELOBJ and any JButton (or other) graphical objects its contains are gone. Now you must construct a new JPanel PANELOBJ like you did initially, populate it with JButtons (or other) as you did initially, and add the new PANELOBJ to its SURROUNDINGOBJ. You can also setvisible(false) on a control such as the JSpinner or a JButton to hide it, later setvisible(true) to show it, and call isvisible() on it to test it. At some point after you remove, add or change visibility of any objects as a result of board size changes, your code must invoke the following two methods on the surrounding FillWordFrame object. validate(); repaint(); The validate() call causes the layout managers to re-lay-out the geometries, and the repaint() call schedules a re-paint of the entire display. Any time that you need to re-run the layout managers your code must invoke validate() and repaint() on the JFrame. Calling getvalue() on either the JSpinner or its SpinnerNumberModel object returns an Integer object (which you must type cast to Integer), as do getminimum() and getmaximum() on the number model. Similarly, setminimum(), setmaximum() and setvalue() take Integer object arguments. To test FillWordBasic change this line in runwindows.bat: to this java FillWord5.FillWordFrame FillWord5.FillWordGrows 10 english.lower.txt -1 java FillWord5.FillWordFrame FillWord5.FillWordBasic 10 english.lower.txt -1 I will test this way and will deduct points from the grows requirement if cangrow() as returned false by FillWordBasic does not interact with the GUI properly. BONUS POINTS: Any major enhancements to the game or GUI beyond those required above will earn 10% each. Any minor enhancements to the game or GUI beyond those required above will earn 5% each. I will decide what is major or minor, and enhancement usage must be clear from playing. The maximum bonus points in this category are 20%. If you add new rules to the game, create a subclass of the appropriate class and test it similarly to the FillWordsBasic test above. java FillWord5.FillWordFrame FillWord5.FillWordYOURCLASS 10 english.lower.txt -1 4
5 Let me know if you plan to do that so I don t miss it. Send me . OPTIONAL 2% BONUS CREDITS I am collecting data for a summer assessment that determines the associations between a) project start date, b) length of work sessions, c) time of day of work sessions, and d) conflicting schedule pressures, and student success on projects as measured by grades and grade improvements. You can earn half of these bonus points (1% additional for the project) by permitting me to collect file sizes, time stamps, time of change, and duration of work session. My automatic script uses a simple ls l command to list directory contents, and it keeps backup copies of your source files to determine amount of code changed per session. The log data goes to my account to keep your account from running out of file space. You need to get data_do_not_lose_this_file.txt from your PC/laptop to me after you are done to get this 1%. Copying it back to FillWord5/ on bill before gmake turnitin is the easiest way. If you do not want to participate, run gmake optout to shut off data collection, and also notify me my using the subject line opt out. I will not collect your data, and if you have already turned some in, I will remove the files. You can earn an additional 1% bonus point by completing a survey in file survey.txt in the project directory. Please fully replace each ****** field with a number. To get this 1% you must also allow data collection for the previous 1%. This survey is not useful without the auto-collected log data. Thus, the total possible points for a project is 102%. The collected data in no way affects your grade, other than by contribution of bonus points. My assessment outlined in the first paragraph of this section could show an association between number of CSC courses that assign you big projects on the same week and the rate of problems encountered completing an assignment. I am looking for ways to improve success rates on projects in future semesters, and I need to collect data in survey.txt and by automatic data collection before I can analyze these data. This is not secret data mining, and I have no time or intention of analyzing the data until this summer. Again, if you wish to opt out of this optional part of assignments, there is no penalty. Additions to IFillWord (THESE ARE ALREADY DONE): 99 /** 100 * Add or deduct points from outside the game. Use this method for 101 * mechanisms such as move timers that are outside the game object. 102 points value to add or negative for deduction. 103 **/ 104 public void addordeductpoints(int points); 105 /** 106 * FillWordRecord provides a means for a game to record & report 107 * the valid move that just completed. An object of FillWordRecord is 108 * immutable. 109 getthismove 110 **/ 111 public static class FillWordRecord implements Cloneable, 112 java.io.serializable { 113 // serialversionuid encodes the version of serializable state. 114 private static final long serialversionuid = L ; 115 /** word placed in the move **/ 116 public final String word ; 5
6 117 /** row of the move **/ 118 public final int row ; 119 /** column of a move **/ 120 public final int column ; 121 /** direction of move, true for across, false for down **/ 122 public final boolean isacross ; 123 /** 124 * Construct a move record from its word, row, column and 125 * direction, where isacross == true for a horizontal word. 126 **/ 127 public FillWordRecord(String word, int row, int column, 128 boolean isacross) { 129 this.word = word ; 130 this.row = row ; 131 this.column = column ; 132 this.isacross = isacross ; 133 } 134 /** 135 * Return the reference to this immutable object as its own clone. 136 **/ 137 public FillWordRecord clone() { 138 return this ; 139 } 140 } 141 /** 142 * Retrieve the move that just completed or null if there was none. 143 the move that just completed or null if there was none. 144 **/ 145 public FillWordRecord getthismove() ; 146 /** 147 * Add a FillWordEventListener to this game. After every update to 148 * the state of the game, the game will construct and send a 149 * FillWordEvent to each subscriber. 150 IFillWord#removeFillWordEventListener 151 **/ 152 public void addfillwordeventlistener(fillwordeventlistener subscriber); 153 /** 154 * Remove a FillWordEventListener added by addfillwordeventlistener. 155 IFillWord#addFillWordEventListener 156 **/ 157 public void removefillwordeventlistener(fillwordeventlistener subscriber); 158 } FillWordEvent.java (THIS IS DONE): 1 /* FillWordEvent.java 2 An Event class that an IFillWord-derived class propagates to 3 subscribers after each change of game state. 4 Dr. Dale Parson, CSC 243, Spring */ 6 7 package FillWord5 ; 8 9 /** 10 Class FillWordEvent propagates to subscribers after each change of 11 game state. 6
7 FillWordEventListener Professor Dale Parson 14 **/ 15 public class FillWordEvent extends java.util.eventobject { 16 // serialversionuid encodes the version of serializable state. 17 private static final long serialversionuid = L ; 18 private final IFillWord changedgame ; 19 /** 20 * Construct a game object and forward it to subscribers after each 21 * change of game state. 22 game is the game making the state change, which also serves as 23 * the event source. This constructor actually stores a clone() of game. 24 FillWordEventListener 25 */ 26 public FillWordEvent(IFillWord game) { 27 super(game); 28 changedgame = game.clone() ; 29 } 30 /** 31 * Retrieve a copy of the game that triggered the event. 32 a clone of the changed game. 33 FillWordEventListener 34 **/ 35 public IFillWord getgame() { 36 return changedgame.clone(); 37 } 38 } FillWordEventListener.java (THIS IS DONE): 1 /* FillWordEventListener.java 2 FillWordEventListener is a listener interface for FillWordEvent. 3 Dr. Dale Parson, CSC 243, Spring */ 5 6 package FillWord5 ; 7 8 /** 9 Interface FillWordEventListener is a listener interface for 10 FillWordEvent that propagates changes in game state to listeners. FillWordEvent Professor Dale Parson 13 **/ 14 public interface FillWordEventListener extends java.util.eventlistener { 15 /** 16 * processgameevent is a client listener's method that receives a 17 * FillWordEvent when a game changes state. 18 FillWordEvent 19 **/ 20 public void processgameevent(fillwordevent event) ; 21 } 7
8 NEWLY ADDED FIELDS FOR FillWordFrame, feel free to use or delete these as you like. 18 private static final int COUNTDOWN_LIMIT = 32 ; // seconds 19 private static final int COUNTDOWN_SHOW = 10 ; // seconds 20 private int countdown = COUNTDOWN_LIMIT ; 21 private int startdown = COUNTDOWN_LIMIT ; 22 private IFillWord game ; 23 private JPanel gamegrid ; 24 private JPanel cmdpaneltop ; 25 private JPanel cmdpanelbottom ; 26 private JPanel cmdpanelouter ; 27 private JLabel wordlbl ; 28 private JButton [][] myboard ; 29 private JButton undobut ; 30 private JButton redobut ; 31 private JButton growboardbut ; 32 private JSpinner growspin ; 33 private SpinnerNumberModel growspinmodel ; 34 private JButton growboardwordbut ; 35 private JLabel scorelbl ; 36 private JButton swapbut ; 37 private JButton savebut ; 38 private JTextField filenametext ; 39 private JButton restorebut ; 40 private JLabel countdownlabel ; 41 private Font newfont ; 8
Here are the steps to get the files for this project after logging in on acad/bill.
CSC 243, Java Programming, Spring 2013, Dr. Dale Parson Assignment 3, cloning & serializing game state for save & restore commands ASSIGNMENT due by 11:59 PM on Thursday April 11 via gmake turnitin Here
More informationHere are the steps to get the files for this project after logging in on acad/bill.
CSC 243, Java Programming, Spring 2014, Dr. Dale Parson Assignment 4, implementing undo, redo & initial GUI layout ASSIGNMENT due by 11:59 PM on Saturday April 19 via gmake turnitin ASSIGNMENT 5 (see page
More informationAssignment 2, perquack2 class hierarchy in Java, due 11:59 PM, Sunday March 16, 2014 Login into your account on acad/bill and do the following steps:
CSC 243 Java Programming, Spring 2014, Dr. Dale E. Parson Assignment 2, perquack2 class hierarchy in Java, due 11:59 PM, Sunday March 16, 2014 Login into your account on acad/bill and do the following
More informationCSC 310 Programming Languages, Spring 2014, Dr. Dale E. Parson
CSC 310 Programming Languages, Spring 2014, Dr. Dale E. Parson Assignment 3, Perquacky in Python, due 11:59 PM, Saturday April 12, 2014 I will turn the solution back on Monday April 14, after which I will
More informationGraphics User Defined Forms, Part I
Graphics User Defined Forms, Part I Quick Start Compile step once always mkdir labs javac PropertyTax5.java cd labs mkdir 5 Execute step cd 5 java PropertyTax5 cp /samples/csc/156/labs/5/*. cp PropertyTax1.java
More informationTo gain experience using GUI components and listeners.
Lab 5 Handout 7 CSCI 134: Fall, 2017 TextPlay Objective To gain experience using GUI components and listeners. Note 1: You may work with a partner on this lab. If you do, turn in only one lab with both
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 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 informationCS 201 Advanced Object-Oriented Programming Lab 6 - Sudoku, Part 2 Due: March 10/11, 11:30 PM
CS 201 Advanced Object-Oriented Programming Lab 6 - Sudoku, Part 2 Due: March 10/11, 11:30 PM Introduction to the Assignment In this lab, you will finish the program to allow a user to solve Sudoku puzzles.
More informationPrototyping a Swing Interface with the Netbeans IDE GUI Editor
Prototyping a Swing Interface with the Netbeans IDE GUI Editor Netbeans provides an environment for creating Java applications including a module for GUI design. Here we assume that we have some existing
More informationCSC 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 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 informationCS 10, Fall 2015, Professor Prasad Jayanti
Problem Solving and Data Structures CS 10, Fall 2015, Professor Prasad Jayanti Midterm Practice Problems We will have a review session on Monday, when I will solve as many of these problems as possible.
More informationReview sheet for Final Exam (List of objectives for this course)
Review sheet for Final Exam (List of objectives for this course) Please be sure to see other review sheets for this semester Please be sure to review tests from this semester Week 1 Introduction Chapter
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 informationGUI Forms and Events, Part II
GUI Forms and Events, Part II Quick Start Compile step once always mkdir labs javac PropertyTax6.java cd labs Execute step mkdir 6 java PropertyTax6 cd 6 cp../5/propertytax5.java PropertyTax6.java Submit
More informationProject 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 informationCSC 220 Object Oriented Multimedia Programming, Fall 2018
CSC 220 Object Oriented Multimedia Programming, Fall 2018 Dr. Dale E. Parson, Assignment 3, text menu on a remote-control Android, mostly array handling. This assignment is due via D2L Assignment Assignment
More informationHigh-Level Design Specification for the Callimuse System
High-Level Design Specification for the Callimuse System CSC354 Introduction to Software Engineering, Dr. Dale Parson, Fall 2013. This assignment is due by end of October 24, 2013 1. Introduction by the
More informationName: CSC143 Exam 1 1 CSC 143. Exam 1. Write also your name in the appropriate box of the scantron
Name: CSC143 Exam 1 1 CSC 143 Exam 1 Write also your name in the appropriate box of the scantron Name: CSC143 Exam 1 2 Multiple Choice Questions (30 points) Answer all of the following questions. READ
More informationPerform the following steps to copy and inspect my initial code handout.
Java classes, interfaces and exceptions Assignment 2 for CSC 243, Spring, 2010, Dr. Dale E. Parson http://faculty.kutztown.edu/parson/spring2010/csc243spring2010.html Assignment 2 is due 11:59 PM on Thursday
More informationCS Exam 1 Review Suggestions
CS 235 - Fall 2015 - Exam 1 Review Suggestions p. 1 last modified: 2015-09-30 CS 235 - Exam 1 Review Suggestions You are responsible for material covered in class sessions, lab exercises, and homeworks;
More informationLecture 5: Java Graphics
Lecture 5: Java Graphics CS 62 Spring 2019 William Devanny & Alexandra Papoutsaki 1 New Unit Overview Graphical User Interfaces (GUI) Components, e.g., JButton, JTextField, JSlider, JChooser, Containers,
More informationProctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.
QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, WINTER TERM, 2012 FINAL EXAMINATION 9am to 12pm, 26 APRIL 2012 Instructor: Alan McLeod If the instructor is
More informationExample: Building a Java GUI
Steven Zeil October 25, 2013 Contents 1 Develop the Model 2 2 Develop the layout of those elements 3 3 Add listeners to the elements 9 4 Implement custom drawing 12 1 The StringArt Program To illustrate
More informationLab Exercise 6: Abstract Classes and Interfaces CS 2334
Lab Exercise 6: Abstract Classes and Interfaces CS 2334 September 29, 2016 Introduction In this lab, you will experiment with using inheritance in Java through the use of abstract classes and interfaces.
More informationExample: Building a Java GUI
Steven Zeil October 25, 2013 Contents 1 Develop the Model 3 2 Develop the layout of those elements 4 3 Add listeners to the elements 12 4 Implement custom drawing 15 1 The StringArt Program To illustrate
More informationCS 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 informationKF5008 Program Design & Development. Lecture 1 Usability GUI Design and Implementation
KF5008 Program Design & Development Lecture 1 Usability GUI Design and Implementation Types of Requirements Functional Requirements What the system does or is expected to do Non-functional Requirements
More informationFirst 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 informationCSC207 Week 4. Larry Zhang
CSC207 Week 4 Larry Zhang 1 Logistics A1 Part 1, read Arnold s emails. Follow the submission schedule. Read the Q&A session in the handout. Ask questions on the discussion board. Submit on time! Don t
More informationGlobal Gomoku Lab 4 in D0010E
Luleå University of Technology February 20, 2012 Computer Science Håkan Jonsson Global Gomoku Lab 4 in D0010E 1 Introduction Modern forms of communication are more and more carried out over the Internet,
More information2IS45 Programming
Course Website Assignment Goals 2IS45 Programming http://www.win.tue.nl/~wsinswan/programmeren_2is45/ Rectangles Learn to use existing Abstract Data Types based on their contract (class Rectangle in Rectangle.
More informationLecture 3: Java Graphics & Events
Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new
More informationWelcome to CIS 068! 1. GUIs: JAVA Swing 2. (Streams and Files we ll not cover this in this semester, just a review) CIS 068
Welcome to! 1. GUIs: JAVA Swing 2. (Streams and Files we ll not cover this in this semester, just a review) Overview JAVA and GUIs: SWING Container, Components, Layouts Using SWING Streams and Files Text
More informationCS Fall Homework 5 p. 1. CS Homework 5
CS 235 - Fall 2015 - Homework 5 p. 1 Deadline: CS 235 - Homework 5 Due by 11:59 pm on Wednesday, September 30, 2015. How to submit: Submit your files using ~st10/235submit on nrs-projects, with a homework
More informationITEC 120 4/14/11. Review. Need. Objectives. GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers. Lecture 38 GUI Interactivity
Review ITEC 120 Lecture 38 GUI GUI basics JFrame JPanel JLabel, JButton, JTextField Layout managers Flow / Box Border / Grid Objectives Need Add interactivity When you click on a button How does your code
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 informationGraphical User Interface (GUI)
Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware
More informationCMP 326 Midterm Fall 2015
CMP 326 Midterm Fall 2015 Name: 1) (30 points; 5 points each) Write the output of each piece of code. If the code gives an error, write any output that would happen before the error, and then write ERROR.
More informationChapter 4 Defining Classes I
Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the
More informationSummary Chapter 25 GUI Components: Part 2
1040 Chapter 25 GUI Components: Part 2 ponent on the line. TheJTextField is added to the content pane with a call to our utility method addcomponent (declared at lines 79 83). MethodaddComponent takes
More informationPART1: Choose the correct answer and write it on the answer sheet:
PART1: Choose the correct answer and write it on the answer sheet: (15 marks 20 minutes) 1. Which of the following is included in Java SDK? a. Java interpreter c. Java disassembler b. Java debugger d.
More informationCSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction
CSC 160 LAB 8-1 DIGITAL PICTURE FRAME PROFESSOR GODFREY MUGANDA DEPARTMENT OF COMPUTER SCIENCE 1. Introduction Download and unzip the images folder from the course website. The folder contains 28 images
More informationCSE331 Winter 2014, Final Examination March 17, 2014 Please do not turn the page until 8:30. Rules:
CSE331 Winter 2014, Final Examination March 17, 2014 Please do not turn the page until 8:30. Rules: The exam is closed-book, closed-note, etc. Please stop promptly at 10:20. There are 116 points total,
More informationLab 5 Classy Chat. XMPP Client Implementation --- Part 2 Due Oct. 19 at 11PM
Lab 5 Classy Chat XMPP Client Implementation --- Part 2 Due Oct. 19 at 11PM In this week s lab we will finish work on the chat client programs from the last lab. The primary goals are: to use multiple
More informationCS61BL: Data Structures & Programming Methodology Summer Project 1: Dots!
CS61BL: Data Structures & Programming Methodology Summer 2014 Project 1: Dots! Note on compiling Board.java You will not be able to compile Board.java until you make your own CantRemoveException class.
More informationCSC 343 Operating Systems, Fall 2015
CSC 343 Operating Systems, Fall 2015 Dr. Dale E. Parson, Assignment 2, modeling an atomic spin lock, a mutex, and a condition variable. This assignment is due via gmake turnitin from the criticalsection2015
More informationCSC 343 Operating Systems, Fall 2015
CSC 343 Operating Systems, Fall 2015 Dr. Dale E. Parson, Assignment 4, analyzing swapping algorithm variations. This assignment is due via gmake turnitin from the swapping2015 directory by 11:59 PM on
More informationCS 180 Final Exam Review 12/(11, 12)/08
CS 180 Final Exam Review 12/(11, 12)/08 Announcements Final Exam Thursday, 18 th December, 10:20 am 12:20 pm in PHYS 112 Format 30 multiple choice questions 5 programming questions More stress on topics
More informationCS 3360 Design and Implementation of Programming Languages. Exam 1
1 Spring 2017 (Thursday, March 9) Name: CS 3360 Design and Implementation of Programming Languages Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and
More information+! Today. Lecture 3: ArrayList & Standard Java Graphics 1/26/14! n Reading. n Objectives. n Reminders. n Standard Java Graphics (on course webpage)
+! Lecture 3: ArrayList & Standard Java Graphics +! Today n Reading n Standard Java Graphics (on course webpage) n Objectives n Review for this week s lab and homework assignment n Miscellanea (Random,
More informationVirtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4.
1 - What if the main method is declared as private? 1. The program does not compile 2. The program compiles but does not run 3. The program compiles and runs properly ( From Lectuer # 2) 4. The program
More informationLab & Assignment 1. Lecture 3: ArrayList & Standard Java Graphics. Random Number Generator. Read Lab & Assignment Before Lab Wednesday!
Lab & Assignment 1 Lecture 3: ArrayList & Standard Java Graphics CS 62 Fall 2015 Kim Bruce & Michael Bannister Strip with 12 squares & 5 silver dollars placed randomly on the board. Move silver dollars
More informationCSE 143: Computer Programming II Spring 2015 HW7: 20 Questions (due Thursday, May 28, :30pm)
CSE 143: Computer Programming II Spring 2015 HW7: 20 Questions (due Thursday, May 28, 2015 11:30pm) This program focuses on binary trees and recursion. Turn in the following files using the link on the
More informationCSC 220 Object-Oriented Multimedia Programming, Spring 2017
CSC 220 Object-Oriented Multimedia Programming, Spring 2017 Dr. Dale E. Parson, Assignment 2, Working with 3D shapes and geometric transforms. This assignment is due via D2L Dropbox Assignment 2 ShapePaint3DIntro
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 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 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 informationAP Computer Science Summer Work Mrs. Kaelin
AP Computer Science Summer Work 2018-2019 Mrs. Kaelin jkaelin@pasco.k12.fl.us Welcome future 2018 2019 AP Computer Science Students! I am so excited that you have decided to embark on this journey with
More informationFinal Exam. Name: Student ID Number: Signature:
Washington University Kenneth J. Goldman Final Exam CSE 132. Computer Science II May 7, 2007 Name: Student ID Number: Signature: Directions: This exam is closed book. You may use one 8 ½ x 11 inch page
More informationCS506 Web Design & Development Final Term Solved MCQs with Reference
with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar
More informationChapter 18. Advanced graphics programming
Chapter 18 Advanced graphics programming Making choices With graphical applications, there are a number of ways of providing choices to the user: pull-down menus; pop-up menus dialogue windows; radio buttons;
More information1st Semester Examinations CITS1001 3
1st Semester Examinations CITS1001 3 Question 1 (10 marks) Write a Java class Student with three fields: name, mark and maxscore representing a student who has scored mark out of maxscore. The class has
More informationTo help you prepare for Problem 2, you are to write a simple Swing application which uses an anonymous inner class to control the application.
Problem Set 5 Due: 4:30PM, Friday March 22, 2002 Problem 1 Swing, Interfaces, and Inner Classes. [15%] To help you prepare for Problem 2, you are to write a simple Swing application which uses an anonymous
More informationCS1110 Spring 2010 Assignment A6. Images. Due Sat. Apr 17, 11:59pm on the CMS 1
CS1110 Spring 2010 Assignment A6. Images. Due Sat. Apr 17, 11:59pm on the CMS 1 0. Introduction Read this entire document carefully. Budget your time wisely. Don't wait until the day before the deadline
More informationCS 2110 Summer 2011: Assignment 2 Boggle
CS 2110 Summer 2011: Assignment 2 Boggle Due July 12 at 5pm This assignment is to be done in pairs. Information about partners will be provided separately. 1 Playing Boggle 1 In this assignment, we continue
More informationCSE 143: Computer Programming II Summer 2015 HW6: 20 Questions (due Thursday, August 13, :30pm)
CSE 143: Computer Programming II Summer 2015 HW6: 20 Questions (due Thursday, August 13, 2015 11:30pm) This assignment focuses on binary trees and recursion. Turn in the following files using the link
More informationComp Intermediate Programming EXAM #1 February 16, 2004 Rice University - Instructors: Cox & Nguyen
Instructions 1. This exam is conducted under the Rice Honor Code. It is a closed-notes, closed-book exam. 2. Fill in your name on every page of the exam. 3. If you forget the name of a Java class or method,
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 informationJava for Non Majors. Final Study Guide. April 26, You will have an opportunity to earn 20 extra credit points.
Java for Non Majors Final Study Guide April 26, 2017 The test consists of 1. Multiple choice questions 2. Given code, find the output 3. Code writing questions 4. Code debugging question 5. Short answer
More informationDue Date: Two Program Demonstrations (Testing and Debugging): End of Lab
CSC 111 Fall 2005 Lab 6: Methods and Debugging Due Date: Two Program Demonstrations (Testing and Debugging): End of Lab Documented GameMethods file and Corrected HighLow game: Uploaded by midnight of lab
More informationHourly Charge Rates Selecting Tasks Editing Task Data Adding Notes to Tasks Deleting Tasks Opening and Saving Files
Time Stamp, Version 3 (2000 2003) by William Rouck, wrouck@syntap.com, http://www.syntap.com Help Contents Welcome License Info Version History Acknowledgements Using Time Stamp Timer Functions Hourly
More informationBe sure check the official clarification thread for corrections or updates to this document or to the distributed code.
Com S 228 Spring 2011 Programming Assignment 1 Part 1 (75 points): Due at 11:59 pm, Friday, January 28 Part 2 (225 points): Due at 11:59 pm, Monday, February 7 This assignment is to be done on your own.
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 informationRAIK 183H Examination 2 Solution. November 10, 2014
RAIK 183H Examination 2 Solution November 10, 2014 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)
More informationEvents and Exceptions
Events and Exceptions Analysis and Design of Embedded Systems and OO* Object-oriented programming Jan Bendtsen Automation and Control Lecture Outline Exceptions Throwing and catching Exceptions creating
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 informationCSC 552 UNIX System Programming, Fall 2015
CSC 552 UNIX System Programming, Fall 2015 Dr. Dale E. Parson, Assignment 4, multi-threading a socket-based server loop & helper functions. This assignment is due via make turnitin from the wordcathreadc4/
More informationCSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2012
CSCI 136 Written Exam #2 Fundamentals of Computer Science II Spring 2012 Name: This exam consists of 6 problems on the following 8 pages. You may use your double- sided hand- written 8 ½ x 11 note sheet
More informationCIS 121 Data Structures and Algorithms with Java Spring 2018
CIS 121 Data Structures and Algorithms with Java Spring 2018 Homework 2 Thursday, January 18 Due Monday, January 29 by 11:59 PM 7 Required Problems (85 points), and Style and Tests (15 points) DO NOT modify
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 informationSYSC Come to the PASS workshop with your mock exam complete. During the workshop you can work with other students to review your work.
It is most beneficial to you to write this mock midterm UNDER EXAM CONDITIONS. This means: Complete the Exam in 3 hour(s). Work on your own. Keep your notes and textbook closed. Attempt every question.
More informationParentConnection User Guide
ParentConnection User Guide Table of Contents How to Access ParentConnection for the Anchorage School District... Welcome Parents!... Computer Requirements... Finding ParentConnection & Logging In... Your
More informationChapter 6 Introduction to Defining Classes
Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of
More informationDUE By 11:59 PM on Thursday March 15 via make turnitin on acad. The standard 10% per day deduction for late assignments applies.
CSC 558 Data Mining and Predictive Analytics II, Spring 2018 Dr. Dale E. Parson, Assignment 2, Classification of audio data samples from assignment 1 for predicting numeric white-noise amplification level
More informationCS 201 Advanced Object-Oriented Programming Lab 5 - Sudoku, Part 1 Due: March 3/4, 11:30 PM
CS 201 Advanced Object-Oriented Programming Lab 5 - Sudoku, Part 1 Due: March 3/4, 11:30 PM Introduction to the Assignment This is the 1 st part of a 2 week lab. When done, you will have a game that allows
More informationMidterm assessment - MAKEUP Fall 2010
M257 MTA Faculty of Computer Studies Information Technology and Computing Date: /1/2011 Duration: 60 minutes 1-Version 1 M 257: Putting Java to Work Midterm assessment - MAKEUP Fall 2010 Student Name:
More informationENGR 3950U / CSCI 3020U (Operating Systems) Simulated UNIX File System Project Instructor: Dr. Kamran Sartipi
ENGR 3950U / CSCI 3020U (Operating Systems) Simulated UNIX File System Project Instructor: Dr. Kamran Sartipi Your project is to implement a simple file system using C language. The final version of your
More informationCome & Join Us at VUSTUDENTS.net
Come & Join Us at VUSTUDENTS.net For Assignment Solution, GDB, Online Quizzes, Helping Study material, Past Solved Papers, Solved MCQs, Current Papers, E-Books & more. Go to http://www.vustudents.net and
More informationRemaining Enhanced Labs
Here are some announcements regarding the end of the semester, and the specifications for the last Enhanced Labs. Don t forget that you need to take the Common Final Examination on Saturday, May 5, from
More informationCS-140 Fall 2017 Test 2 Version A Nov. 29, 2017
CS-140 Fall 2017 Test 2 Version A Nov. 29, 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 : An interface defines the list of fields
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 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 informationCOMP 1006/1406 Assignment 1 Carleton Foodorama (Part 1) Due: Friday, July 14 th 2006, before 11h55 pm
COMP 006/406 Assignment Carleton Foodorama (Part ) Due: Friday, July 4 th 2006, before h55 pm In this assignment, you will review basic concepts from COMP 005. You will get to design a simple text-based
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 informationPerform the following steps to set up for this project. Start out in your login directory on csit (a.k.a. acad).
CSC 458 Data Mining and Predictive Analytics I, Fall 2017 (November 22, 2017) Dr. Dale E. Parson, Assignment 4, Comparing Weka Bayesian, clustering, ZeroR, OneR, and J48 models to predict nominal dissolved
More informationDartmouth College Computer Science 10, Fall 2015 Midterm Exam
Dartmouth College Computer Science 10, Fall 2015 Midterm Exam 6.00-9.00pm, Monday, October 19, 2015 105 Dartmouth Hall Professor Prasad Jayanti Print your name: Print your section leader name: If you need
More informationProgramming Project 1
Programming Project 1 Handout 6 CSCI 134: Fall, 2016 Guidelines A programming project is a laboratory that you complete on your own, without the help of others. It is a form of take-home exam. You may
More information