-
different output
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class Steps extends Applet implements AdjustmentListener {
private Scrollbar steps;
private int count, numberOfSteps;
public void init() {
steps = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 100);
add(steps);
steps.addAdjustmentListener(this);
}
public void paint(Graphics g) {
int count = 0;
int x = 20;
int y = 20;
while (count < numberOfSteps) {
g.drawLine(x, y, x + 20, y );
g.drawLine(x + 20, y, x+20, y + 20);
x = x + 20;
y = y + 20;
count++;
}
}
public void adjustmentValueChanged(AdjustmentEvent e) {
numberOfSteps = steps.getValue();
repaint();
}
}
-
Need a question to do anything with this.
-
Hey pro85,
You have to clearly mentioned what's your question here. If you didn't to it on next few days, I have to delete this thread. Sorry for that, but since nothing is there to discuss no need keep this thread here in the forum. Others can be confused. So pay your attention there. :)
-
result
i want
_
l_
l_
l_ this is my result
but error occur
_
l_
l
-
y i can not post the link
-
Since you don't have total number of 20 posts, it's not possible to post links here in our community. Until that you just put the link text here.
-
If you are getting an error, copy the contents of the Java console and paste it here.