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


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

setBounds on JScrollBar needs validate()?

Newsgroups comp.lang.java.gui
Date 2013-02-08 10:09 -0800
Message-ID <29b26e5f-4f74-470f-99ab-ec407572ad23@googlegroups.com> (permalink)
Subject setBounds on JScrollBar needs validate()?
From FredK <fred.l.kleinschmidt@gmail.com>

Show all headers | 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