File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems in the paint method

 
Chandar S Vellithirumutha
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying run an applet with the paint method as below. The paint method gets called in an infinite loop. CAn any one help me.
Thanks
Chandar
public void paint(Graphics g) {
setScale();
Graphics g1 = drawArea.getGraphics();
for (int i=0;i<noOfElements;i++) {setForeground(colorArray[i%colorArray.length]);
g.fillRect(i*BARGRAPHWIDTH,GRAPHHEIGHT - (int)
(scaleFactor * d[i]),BARGRAPHWIDTH,(int)(scaleFactor * d[i]));
}
}
public void setScale() {
int i = 0;
while((bigElement = bigElement/Math.pow(10,i)) > Integer.MAX_VALUE) i++;
for (int x=0;x<noOfElements;x++) {
intD[x] =(int)(d[i] = d[i]/Math.pow(10,i));
}

scaleFactor = GRAPHHEIGHT / bigElement;
return;
}
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really a question for the Applets forum
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic