| Author |
having some minor problems
|
Martin vanPutten
Ranch Hand
Joined: Mar 26, 2006
Posts: 124
|
|
I havn't done an applet in a while. Can somebody point out why I'm not viewing anything within the applet? Also, I want to double buffer it but I had to comment out the getContentPane(). It says that it could not read it. Any reason for that as well?
|
Live And Let Learn.
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
First, you probably meant to extend JApplet. Also notice the capitilization of Painter.
|
 |
Vishal Mungi
Greenhorn
Joined: Mar 24, 2005
Posts: 24
|
|
If you extend applet you add components directly : add(new painter()); If you extend JApplet you add components to the content pane: getContentPane.add(new painter()); when extending a JPanel you override the paintComponent method & not paint (http://leepoint.net/notes-java/GUI-lowlevel/graphics/40drawingpanel/10drawingpanel.html) Also, dont forget to call super.paintComponent first. [ December 07, 2006: Message edited by: Vishal Mungi ]
|
 |
Martin vanPutten
Ranch Hand
Joined: Mar 26, 2006
Posts: 124
|
|
|
The getContentPane compiles now... and Painter class is capitalized but it still doesn't give me a black background. I feel like i'm missing something. Any suggestions?
|
 |
 |
|
|
subject: having some minor problems
|
|
|