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

What's the best method to override when drawing?  RSS feed

 
Malith Yapa
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellas,

Say i wanted to draw my own button using java primitives. What's the best method to override. I extended the JButton class and tried bot paint() and paintComponent() but none of them are working. Is there another way of doing this? I just want to draw my button as i like it. Please help. Thanks. Cheers..
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overriding paintComponent should work. It the method being called at all? This section of the Java Tutorial is helpful reading.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!