very strange problem with paintComponent()functiom
Hi
i have strange error with panitComponant function in class extend JPanel ,when i create object from that class ans add it to certain frame it continously repeat excuting the paintComponent function in infinite loop until the following exception appears
fException in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
any solutions?
[379 byte] By [
Elnegma] at [2007-10-3 12:01:12]

public void paintComponent(Graphics g)
{ super.paintComponent(g);
Graphics2D g2=(Graphics2D) g;
Line2D L;
float tempx,tempy,x,y;
g2.setColor(Color.BLACK);
g2.drawLine(0,260,580,260);
g2.drawLine(10,0,10,280);
x=(float)((QT.get(0).getX()*580)/MX);
y=(float)((QT.get(0).getY()*260)/MY);
g2.setColor(Color.BLACK);
for(int i=1;i<QT.size();i++)
{
tempx=(float)((QT.get(i).getX()*580)/MX);
tempy=(float)((QT.get(i).getY()*260)/MY);
L=new Line2D.Float(x,260-y,tempx,260-tempy);
g2.draw(L);
}
return;
}
This is the method>