• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling the paint() method of superclass()

 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Readers,
Belated Merry X'Mas. Can over-rided methods of superclass be called??
This is what I have:




Please suggest on what I should do if the above technique is not possible. This is because the basic layout of the Graph will be painted by the superclass paint() method.

With Best Regards,
Shyam Prasad Murarka
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should be using paintComponent(), instead of paint()
then BarGraph's code becomes

 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Readers,
Thanks very much Michael. I shall try that out very soon.
 
Brian Cole
Author
Ranch Hand
Posts: 899
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you embolden text within a code block?
I didn't think that was possible on javaranch.
 
Shyam Prasad Murarka
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Readers,
Well, just nest up the tags.
Instead of these signs '<' and '>' you have to use the normal ones like '[' and ']'. I used it here so that you could see it without that also getting parsed.

<code>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic