🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7867

Re: FlowLayout and JScrollPane

#7867
From: Rich Wilkman
Date: Mon, 04 Dec 2000 00:00
40 lines
2100 bytes
Thomas:

I'm pretty sure that's just FlowLayout doing what it's supposed to do.  FL will
wrap when it hits the end of it's container.  If you stick it in a scroll pane
then it never hits the right edge of the container (the scroll pane takes over
and you get the H bar).  Try locking down the number of columns in the
FlowLayout by setting the cols value to something other than 0.  Make sure Rows
is 0 and try again.  I can't remember if I tried this when I ran into this
problem.

You could also extend Flow Layout to wrap after a certain number of items exist
on a row.

-Rich


"Thomas G�lden (p)" wrote:

> I try to develop an image browser, where thumbnails of images are put in
> rows.
> So to use the FlowLayout as the layout for my panel seems to be the right
> choice, because it puts components in a new row when one row is full,
> depending on the width of the panel. However, when the rows extend the
> height of my panel I would like to show a scrollbar on the right of the
> panel.
>
> So I thought to put a scrollpane into my panel. But this results in a
> different behaviour of my FlowLayout since new rows are not created and a
> horizontal scrollbar is created at the bottom.
>
> I would like to have the original behaviour of my FlowLayout kept, and only
> have a vertical scrollbar created, when I have to many rows for my panel to
> display.
>
> How can I achive this behaviour ?
>
> Thanks
>
> Thomas G�lden
> Thomas.Guelden@t-online.de
Technical Details
Message-ID: <3A2BD51C.93E3C94@formlessvoid.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <90dkq2$fr4@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,282a839afa7c07f
X-Google-Attributes: gid111d45,public
From: Rich Wilkman <richw@formlessvoid.com>
Subject: Re: FlowLayout and JScrollPane
Date: 2000/12/04
Message-ID: <3A2BD51C.93E3C94@formlessvoid.com>
X-Deja-AN: 701021733
Content-Transfer-Encoding: 8bit
References: <90dkq2$fr4@bornews.inprise.com>
X-Accept-Language: ja,en
Content-Type: text/plain; charset=iso-8859-1
X-Trace: 4 Dec 2000 09:33:31 -0800, 209.144.169.10
MIME-Version: 1.0
Reply-To: richw@formlessvoid.com
Newsgroups: borland.public.jbuilder.java.swing