Making Scrollbars Appear

From: kag ("kag")
Date: 07/23/04


Date: Fri, 23 Jul 2004 08:45:19 -0700

I have a KPanel class derived from JPanel. It is embedded in a JScrollPane.
Initially the panel is blank and does not require scrollbars. As information
is written to the panel, its size grows until scrollbars are required. I am
overriding getPreferredSize in KPanel. Whenever information is added to the
panel, I call repaint() on the JScrollPane, but this does not result in a
call to KPanel's getPreferredSize. If I manually resize the window,
getPreferredSize does get called and the scrollbars appear. How can I get
the scrollbars to appear programmatically?



Relevant Pages

  • Re: Setting Proportional Width of Bound GridView
    ... I'm afraid there is no way how to use proportional size and scrollbars ... If I set the Panel width explicitly, it all works OK, but then when I ... resize the browser window, the panel doesn't resize. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem positioning controls within a panel with autoscroll=true
    ... > I have a panel with autoscroll=true, and I am trying to position controls ... > bit after creating a few of these diagonal boxes, it jumps a huge gap, ... > whether or not the scrollbars have been moved at all. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Making Scrollbars Appear
    ... >is written to the panel, its size grows until scrollbars are required. ... >overriding getPreferredSize in KPanel. ... Use revalidateon your KPanel, ...
    (comp.lang.java.gui)
  • Re: Making Scrollbars Appear
    ... >>I have a KPanel class derived from JPanel. ... >>is written to the panel, its size grows until scrollbars are required. ... > Use revalidate() on your KPanel, ...
    (comp.lang.java.gui)
  • Re: Scrollable PictureBox
    ... Yeah, this did occur to be one way to do it, and it seems to be smoother ... than fiddling around with scrollbars. ... > I have done this by placing the PictureBox into a Panel. ... > PictureBox control to be larger than the Panel Width and Height. ...
    (microsoft.public.vsnet.general)