Re: Labels not displaying properly...help!?

From: B J H (no_at_one.com)
Date: 12/10/03


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



Relevant Pages

  • Re: Labels not displaying properly...help!?
    ... A class which is used to control the temperature of a Reactor ... private static final int MAX = 10; ... private boolean alarm; ...
    (comp.lang.java.gui)
  • E39 alarm question.
    ... Reset it and within a minute it went off again. ... I then set it with the interior and movement sensor disabled, and the alarm didn't go off again. ... The interior of the car was extremely hot BTW. ... Seems it might be connected to the interior car temperature. ...
    (alt.autos.bmw)
  • Re: E39 alarm question.
    ... Reset it and within a minute it went off again. ... I then set it with the interior and movement sensor disabled, and the alarm ... The interior of the car was extremely hot BTW. ... Seems it might be connected to the interior car temperature. ...
    (alt.autos.bmw)
  • Re: E39 alarm question.
    ... Reset it and within a minute it went off again. ... I then set it with the interior and movement sensor disabled, and the alarm didn't go off again. ... In the evening when it was much cooler, I reset the alarm to make it fully functional again, and it went through the night without any problem, and has been OK all day. ... Seems it might be connected to the interior car temperature. ...
    (alt.autos.bmw)
  • JFormattedTextField question
    ... * An applet that displays a fahrenheit to celsius conversion table. ... * limits of fahrenheit temperature may be entered, ... private int getIntValue ... * @return an int value containing the default tab spacing ...
    (comp.lang.java.help)