Re: Making Scrollbars Appear

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

  • Next message: Sandip Chitale: "What different mechanisms for scrolling are available in the GUI toolkits - AWT, Swing, SWT, Others?<EOM>"
    Date: Fri, 23 Jul 2004 11:44:51 -0700
    
    

    REvalidate()! That's the magic bullet! Thanks!

    "Thomas Fritsch" <no.spam@www.invalid> wrote in message
    news:1090603893.676613@igate1.ops.de...
    > kag wrote:
    >
    > >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.
    > >
    > Use revalidate() on your KPanel, whenever you change the KPanel's
    > preferred size.
    > See http://mindprod.com/jgloss/scrollbar.html
    >
    > > If I manually resize the window,
    > >getPreferredSize does get called and the scrollbars appear. How can I
    get
    > >the scrollbars to appear programmatically?
    > >
    > >
    > >
    > --
    > Thomas<dot>Fritsch<squiggle>ops<dot>de
    >


  • Next message: Sandip Chitale: "What different mechanisms for scrolling are available in the GUI toolkits - AWT, Swing, SWT, Others?<EOM>"

    Relevant Pages

    • 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. ... >> overriding getPreferredSize in KPanel. ...
      (comp.lang.java.gui)
    • Re: can paint panel scrollable ?
      ... I would suggest creating a JScrollPane and adding the panel to it. ... Whenever you draw on the panel, reset the preferred size and revalidate ... be scrollbars so that you can scroll to see everything on the panel. ...
      (comp.lang.java.help)
    • 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)