• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in repaint  RSS feed

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i click on the button from bottom panel, top panel need to be redrawn. But redrawing is not happening. It happens only when resizing the applet. Please someone guide me in fixing this issue.TIA.

 
Rob Camick
Ranch Hand
Posts: 2787
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above line of code does nothing. You create a panel, but that panel just sits in memory because you didn't add the panel to the frame.



The repaint() will only paint the panel that contains the button. If you also want to repaint a different panel then you probably need to invoke repaint() on the parent panel that contains the two panels. Something like:

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ImagePanel2() is already added to the parent. now i want it to reload based on changes.
changed the code,

even after that the panel is not getting refreshed. but its refreshing if i resize the panel.
 
Rob Camick
Ranch Hand
Posts: 2787
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The updated code you posted still does nothing. The panel is still not added to the frame. However, you should NOT even be trying to create a new panel.

now i want it to reload based on changes


Then add "setter" methods to change the properties of your panel.

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is has been already added in init method. I have modified my code for easy understanding and given here.
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any leads?? TIA.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any leads? You seem to have been ignoring the perfectly good leads which Rob Camick gave you. As for the revised code you posted, all I can see is that you have changed the names of your panel classes. That just makes it harder to figure out your problem, which by the way your last post didn't describe.
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, i will remove the new code added.
 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed code.and continue with previous one.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!