Hi,
I've created a class that extends a JPanel and I have override the paintComponent() method. The problem is, whenever I call a repaint() from another method ( doSomething()), the paintComponent() was not called. The doSomething() method is called when user click a button after he/she insert the 'a' and 'b' value into 2 textfields.
Why is that?
here is some of my code:
int x, y;
public void doSomething(int a, int b)
{
x = a;
y = b;
repaint();
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawLine(x,y,x+50,y+50);
}
Any idea or suggestion??
