Never mind I've figured it out myself, I just had to move
int shortnumb2 = (int) shortnumb;
int length2 = (int) length;
into the public void paint class.
Thanks for all your help :)
Type: Posts; User: rph
Never mind I've figured it out myself, I just had to move
int shortnumb2 = (int) shortnumb;
int length2 = (int) length;
into the public void paint class.
Thanks for all your help :)
Yeah that's what the problem was, I hadn't declared length2 as a class variable, thanks :)
However now I have the problem that the conversion from double to int makes the int value 0, any ideas why...
Ok I think I got that, but BlueJ is saying that I'm having an error still.
import java.awt.*;
import javax.swing.*;
public class goldenrect extends JApplet
{
double length;
public void...
I need to convert the result of a calculation from type double to type int, what's the best way of going about this?
I need to do this because I need the results of the calculation to be the length...