Originally posted by Campbell Ritchie:
By the way: it isn't public void paintComponent(Graphics g). If you use Java 1.4.2 or older it's protected void paintComponent(Graphics g) and if you use Java 5 or newer it's
@Override
protected void paintComponent(Graphics g).
Originally posted by Campbell Ritchie:
And you always put
super.paintComponent(g);
as the first line of that method.[/QB]
now since i know that even if i don't the compiler will place a call to the method of the super class. Am i right?
what role does the super class's paintComponent() method will play in my code
Campbell Ritchie wrote:You will always get an error if you try to start an application from a class without a main method.
If you put "public" inside a method the compiler will always flag that as an error; you can't have methods inside methods.
By the way: it isn't public void paintComponent(Graphics g). If you use Java 1.4.2 or older it's protected void paintComponent(Graphics g) and if you use Java 5 or newer it's
@Override
protected void paintComponent(Graphics g).
And you always put
super.paintComponent(g);
as the first line of that method.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Alexander McDougall wrote:I am currently experiencing the same problem.
/snip/
Any one able to help?
luck, db
There are no new questions, but there may be new answers.