Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

panel - repaint();

 
Roldan Baldo
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a panel1 and panel2, panel2 is where the picture is displayed and i set to true the setDoubleBuffered,
and i have a button called "UP" and "DOWN", if I press DOWN the image will scaled down as what ive set it to.
and if I press UP it do the other way around,

the problem is sometimes when i press UP/DOWN the image wont resize, (or is it the panel that the action will not be performed),
and i will press again UP/DOWN, it resize again.
what could the problem?


i called this every time i pass a new image


this works fine for me, but it just dont repaint() i think sometimes.. any help would be appreciated..
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I gather that you are adding and removing components from a container. Do you revalidate the container after doing this? Are you sprinkling your code with println statements to check if code that should be called is being called and to check the state of critical fields at the time of the calls.

If my suggestion doesn't help, you may wish to create a small compilable program that is compilable and runnable by us and that demonstrates your problem.

Much luck!
 
Roldan Baldo
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it works well.

cheers..

thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic