File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Problems in the paint method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Problems in the paint method" Watch "Problems in the paint method" New topic

Problems in the paint method

Chandar S Vellithirumutha

Joined: May 29, 2000
Posts: 15
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.
public void paint(Graphics g) {
Graphics g1 = drawArea.getGraphics();
for (int i=0;i<noOfElements;i++) {setForeground(colorArray[i%colorArray.length]);
(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;
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
This is really a question for the Applets forum

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Problems in the paint method
It's not a secret anymore!