Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

advanced flickering  RSS feed

 
Stepan Kolesnik
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to create a dialog with dynamicly-sized panels which user would be able to extend/hide like the ones in various Properties dialogs in Netbeans.

I am using JPanel with GroupLayout as my container. Extendable panels are resizable horizontally, but vertically they are fixed size. As soon as the panel extend/hide button is pressed I do the following:
- hide or show the content pane of that group via setVisible();
- resize main JPanel accordingly (ie. add or subtract panel's content pane height);
The code for action handler;


This works, bit the flickering.. OMG. It is really bad. I have tried to override update, paint etc. I have even introduced a boolean variable to stop painting in every window, until the function returns, but it did not solve it. Any ideas?
Basically I want the window to be DEAD until I have shown/hidden necessary components and resized it.
[ October 04, 2007: Message edited by: Stepan Kolesnik ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't really have an answer, but you could try adding this
frame.setIgnoreRepaint(true);//probably cause other problems

would be better if you could post a small version of your program that
we can copy/paste/compile/run/seeProblem/tinker

strip everything from the code unrelated to the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!