• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

advanced flickering

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic