Re: Labels not displaying properly...help!?
From: B J H (no_at_one.com)
Date: 12/10/03
- Next message: Sandip Chitale: "Re: Viewing GridBagLayout's Grid Lines?"
- Previous message: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- In reply to: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Next in thread: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Reply: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 10 Dec 2003 02:42:45 GMT
Reactor.java is irrelevant if you looked at my quesion (which related to the
positioning of elements on the screen). That is why I did not post it (as I
feared being flamed for posting irrelevant code).
Here goes..
/*
* File: Reactor.java
* Description: A class which is used to control the temperature of a Reactor
* object by providing methods which increase, decrease and display the
* current temperature. THIS CLASS IS INCOMPLETE.
*/
public class Reactor
{
private static final int MAX = 10; // set maximum temperature
private static final int MIN = 0; // set minimum temperature
private int temperature;
private boolean alarm;
public Reactor()
{
temperature = 0; // set initial level
}
public int getTemperature()
{
return temperature;
}
public boolean increaseTemp()
{
boolean alarm;
if (temperature < MAX)
{
temperature++;
alarm = false;
}
else
{
temperature = 0;
alarm = true;
}
return alarm;
}
public boolean decreaseTemp()
{
if (temperature >= MIN)
{
temperature--;
alarm = false;
}
else
{
temperature = 0;
alarm = true;
}
return alarm;
}
} //end class Reactor
- Next message: Sandip Chitale: "Re: Viewing GridBagLayout's Grid Lines?"
- Previous message: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- In reply to: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Next in thread: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Reply: Andrew Thompson: "Re: Labels not displaying properly...help!?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|