Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

graphics  RSS feed

 
rob armstrong
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wanted to make a car class. Various different cars so it extends vehicle. I want a JFrame and a JPanel or JComponent in the center of it.

I think i need to extend JCoponent on vehicle so it has tooltips
public class Vehicle extends JComponent{}

but when i override JPanel and create vehicle objects by overriding paintComponent(Graphics){} it does display tooltips when viewing the JFrame that the JPanel is added to.

i think the add() method is only way to use tooltips not paint methods but...
How can i make a Shape object with tooltips than???
roba
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the AWT/Swing/GUI forum, where this question is more likely to get answered.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!