class TheBannerRunner extends Runnable {
Label theLabel;
public TheBannerRunner(Label theLabel) {
this.theLabel = theLabel; // Save the reference to the label we're to update
}
...
Type: Posts; User: Norm
class TheBannerRunner extends Runnable {
Label theLabel;
public TheBannerRunner(Label theLabel) {
this.theLabel = theLabel; // Save the reference to the label we're to update
}
...
How to pass a reference to a class?
A couple of ways:
In the constructor.
In a settor method.
Another approach would be to have your banner class extend the label class and have the Applet...
Not sure what that means.
The thread will started with a reference to the Label which is shown in the Applet's GUI. It can change the contents of the label and tell the applet to repaint its GUI to...
The place I'm talking about is GUI. Something like a JLabel in the applets GUI area.
In the applet you create a Thread object and start it. Say in the init() or start() method.
Take a two step approach.
First create the Calculator applet with a place that shows the banner.
Then add a thread to move the contents of the place holding the banner.
You must put the method calls(the add()s) inside of a method. They appear to be outside with the variable defs.
Why do you have two classes that extend Applet? Only one of them is used by the browser as an applet. The CalculatorApplet class's methods (init and start) are NOT going to be called by the...
Look at the Double class and see if there are any methods or values you can use to test the results against.
Put the banner on a thread. Leave the calculator as you normally would.
For NaN, how do you detect divide by 0? try{}catch(){}
Compute the result and put it in a String. If you detect div by 0, set...
Can you explain what the calculator class is supposed to do?
The banner class I guess should have a panel where it can change the contents like a scrolling banner.
But why put the calculator on its...