Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Redrawing a graph  RSS feed

 
Ashish Gupta
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a question regarding re-drawing a graph in my GUI application. I have a JPanel which contains two other JPannels. In one of the pannels I have a JComboBox and in other I draw a graph using Graphics class. I want to change the graph when the JComboBox selections is changed.
Currently, graph remains to what it is when application is first launched.
It seems that 'paintComponent' method is not called when I rebuild the graphics JPanel.
Thanks
Ashish
 
Ashish Gupta
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello GUI gurus,
Any help/pointers will be helpful.
To sum, I want to know how to re draw an image on JPanel once it has been drawn on launching the application.
Thanks
Ashish
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.
Are you invoking repaint on the panel when the button is pushed?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!