Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

advanced flickering

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
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.
Why is the word "abbreviation" so long? And this ad is so short?
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!