Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456 WU CS 231 Lab 1: GUI Greetings
CS 231 Lab 1: GUI Greetings
A simple first assignment
This lab is intended to give you a first exposure to the NetBeans programming environment.
Your task will be to write and run a program similar to the one demonstrated in lecture,
which will use a graphical user interface (or GUI) to put a greeting on the screen at
the press of a button.
(You may use any greeting text, style, button arrangement , etc. that you find pleasing, or easy.
Feel free to explore the interface a little and try out different options.
But the point is not what the interface looks like, but the fact that you get it wo work.)
You should follow these steps (just as in lecture) to get your program going:
open the NetBeans program;
create a new project (leftmost menu) and store it on your "H" drive
(use the general/Java application choices, and a name such as "GUIGreet");
right click on the name of your project in the project listing (upper-left
panel of the IDE);
add a new JFRame component, with an appropriate name (and put it in a new package,
say "GreetPackage");
click and drag a new JTextField (from the pallete on the right) into your
JFrame (you may want to clear out its text contents and set its style
properties, using the properties pallete on the lower-right);
add a new JButton and name it appropriately;
right click on the JButton to choose a new event response/action/action performed;
add the program line jTextField1.setText("Hello!") (or similar
wording) to the code for the button.
Finally, you can run your program using the "Run main project" menu item to see
that it works.
As usual, the grading will be by live demonstration (or "demo") during lab time.
Have your program ready by Tuesday 5 September at the latest.