{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Activity_4B - COMP 1210 Activity 4B Graphical User...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COMP 1210 Activity 4B: Graphical User Interface COMP 1210 | Fall 2009 1 Due: Monday, September 21, 2009 Note: In order to complete this activity, you will need to have the Thermostat class that you created in Activity 4A. Program Description: In this activity you will create a class called ThermostatGUI, which will represent an interface through which users can interact with your Thermostat class from Activity 4A. The following figure shows an example of the GUI that you will create. When users press the update button, input is taken from the two text fields and displayed next to the update button. Directions: Step 1: Create your class and add comments Create a class that represents the panel designed to hold the GUI. import java.awt.*; import java.awt.event.*; import javax.swing.*; ÕÖ× public class ThermostatGUI extends JPanel{ § //declare instance variables § § Þßà public ThermostatGUI(){ § § //instantiate Thermostat object § § //instantiate button and text fields § § //instantiate JLabels § § //add action listener to button § § //add components to the panel § § //set the panel characteristics § © } § § Þßà public static void main(String[] args){ § § //create a frame for the panel Represents the panel in which your GUI components will be placed.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}