|
-
Mar 26th, 2002, 10:47 AM
#1
Thread Starter
Fanatic Member
manually calling paint
how do i pass it "Graphics g"?
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Mar 26th, 2002, 11:33 AM
#2
Thread Starter
Fanatic Member
nvermind, got it
Code:
paint(getGraphics());
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Mar 26th, 2002, 06:38 PM
#3
From what I know, paint() is a callback, and should only be called directly by the system (not that it really makes a difference), you should just call the repaint() method.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Mar 28th, 2002, 01:36 PM
#4
Thread Starter
Fanatic Member
repaint didn't work for some reason.
calling paint() did it, sort of. now i overrode the paint() function itself so no more flickering
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
Apr 1st, 2002, 01:33 AM
#5
Hyperactive Member
Originally posted by crptcblade
From what I know, paint() is a callback, and should only be called directly by the system (not that it really makes a difference), you should just call the repaint() method.
could you plz tell me more about the repaint() method? i 've never got it to work... PLZ!
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Apr 2nd, 2002, 12:59 AM
#6
Dazed Member
Code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class RedDewDrop{
public static void main(String[] args){
new Circle();
}
}
class Circle extends Canvas{
public Circle(){
JFrame jf = new JFrame("DewDrop");
jf.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
Dimension size = jf.getSize();
Insets i = jf.getInsets();
int height = size.height - i.top - i.bottom;
int width = size.width - i.left - i.right;
this.setSize(height,width);
jf.getContentPane().add(this);
jf.setSize(400,300);
jf.setVisible(true);
}
public void paint(Graphics g){
g.setColor(Color.red);
for(int i = 0; i < 100; i++){
g.fillOval(50,50,i,i);
try{
Thread.sleep(100);
}catch(Exception e){System.err.println(e);}
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|