

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Instructions on running and compiling java code at the command line, dealing with exceptions, and creating a simple graphical user interface (gui) using vassar college's cmpu-101 course material. It covers writing a main method, compiling code, running code with arguments, printing to the terminal, static methods, and handling exceptions. Additionally, it introduces the swing library for creating a gui and the swing interactor hierarchy.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Running and compiling code at the command line (i.e. the "system prompt"):
Please Please dodo notnot presspress thisthis buttonbutton again.again. Arthur listened for a short while, but being unable to understand the vast majority of what Ford was saying he began to let his mind wander, trailing his fingers along the edge of an incomprehensible computer bank, he reached out and pressed an invitingly lit up with the words “Please do not press this button again. large red button on a nearby panel. The panel” — Douglas Adams, Hitchhiker’s Guide to the Galaxy, 1979 The HitchhikerButton program on the next slide uses this vignette from Hitchhiker’s Guide to the Galaxy to illustrate the process of creating a GUI without focusing on the details. The code creates a single button and adds it to the SOUTH region. It then waits for the user to click the button, at which point the program responds by printing a simple message on the console. HitchhikerButton Red
import acm.program.; import java.awt.event.; import javax.swing.; /
The following diagram shows the Swing classes used in this text. With the exception of IntField and DoubleField , all of these classes are defined in the javax.swing package. JComponent AbstractButton JSlider JLabel JComboBox JButton JToggleButton JTextComponent JCheckBox JRadioButton JTextField IntField DoubleField acm.gui ButtonGroup