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


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

setBounds on JScrollBar needs validate()?

X-Received by 10.224.72.199 with SMTP id n7mr3702989qaj.5.1360346941052; Fri, 08 Feb 2013 10:09:01 -0800 (PST)
X-Received by 10.49.47.109 with SMTP id c13mr539901qen.3.1360346941033; Fri, 08 Feb 2013 10:09:01 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!p13no3009983qai.0!news-out.google.com!k2ni21154qap.0!nntp.google.com!p13no3009978qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.gui
Date Fri, 8 Feb 2013 10:09:00 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=130.76.32.78; posting-account=_7xgmwoAAADi7iXKBO-oX5zbCfSzsCV0
NNTP-Posting-Host 130.76.32.78
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <29b26e5f-4f74-470f-99ab-ec407572ad23@googlegroups.com> (permalink)
Subject setBounds on JScrollBar needs validate()?
From FredK <fred.l.kleinschmidt@gmail.com>
Injection-Date Fri, 08 Feb 2013 18:09:01 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.gui:5300

Show key headers only | View raw


I have created a component that extends JPanel and implements LayoutManager.
This component contains a JScrollBar child. When my layoutContainer() 
method is called due to a resize, I call scrollbar.setBounds() and 
everything draws correctly.

But when I need to reset the position of the scrollbar due to some 
internal action in my component, when I call scrollbar.setBounds() 
the scrollbar gets the correct size, but the arrows and slider are 
not updated unless I also call scrollbar.validate().  

I would have thought that this would be done automatically when I resize 
the JScrollBar. This is the only component I have found that acts this 
way. For example, a JSlider repaints itself properly after setBounds(), 
without having to call validate().

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar


Thread

setBounds on JScrollBar needs validate()? FredK <fred.l.kleinschmidt@gmail.com> - 2013-02-08 10:09 -0800
  Re: setBounds on JScrollBar needs validate()? Roedy Green <see_website@mindprod.com.invalid> - 2013-02-13 18:50 -0800

csiph-web