Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1415

Re: Strange GUI problem..

From "Judy Szikora" <judy.szikora@THRWHITE.remove-dii-this>
Subject Re: Strange GUI problem..
Message-ID <CXsSh.47107$DE1.46252@pd7urf2no> (permalink)
Newsgroups comp.lang.java.gui
References <1175999573.425707.127390@b75g2000hsg.googlegroups.com>
Date 2011-04-27 15:33 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui,comp.l
Daniel Pitts wrote:
> Its hard to distill into an SSCCE, so I'll describe the problem as
> well as I can...
> 
> I have a (rather complex) view, layed out with GridBagLayout.  It
> contains a JPanel in the very middle, which has a slightly transparent
> background.
> 
> I have 4 visible JFrames which have this layout.
> 
> This middle panel starts out with a JButton in it. when the JButton is
> pressed, all the middle panels remove their button, and replace it
> with a JLabel.
> 
> When this happens, the JPanel appears to be partially redrawn with a
> shared double-buffer which isn't cleared properly.
> 
> In other words, I'm seeing parts of my complex layout appear within
> the middle panel, partially drawn over, and definitely not where they
> belong.  Any suggestions?
> 
> My current work around is that when the JPanel removes its button, it
> called revalidate (which IS appropriate and correct), but then it
> calls getTopLevelAncestor().repaint();
> 
> Is there a better solution?
> 

JComponent has an 'opaque' property which it uses to decide whether to 
repaint the ancestors, make sure it is set to false.

-- 
Judy Szikora, Apprisant Technologies Inc.
http://www.apprisant.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Strange GUI problem... "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: Strange GUI problem.. "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
    Re: Strange GUI problem.. "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
      Re: Strange GUI problem.. "Knute Johnson" <knute.johnson@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: Strange GUI problem.. "Judy Szikora" <judy.szikora@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
    Re: Strange GUI problem.. "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
      Re: Strange GUI problem.. "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000

csiph-web