🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.programmer
Article #206

Re: help with applet layout!

#206
From: Silent Knight
Date: Thu, 22 Jul 1999 00:00
39 lines
2412 bytes
> With FlowLayout, is there any type of command to make the layout
process
> go to the next line and continue layoung out the additional
components?
> For example, if I wanted a button on one line, and the next button on
> the next line, what is the easiest way to make flow layout to do it?

I think the point of FlowLayout is that the container decides for itself
how to layout the components ... if you want more control you should use
a different layout manager, eg. GridLayout(1,2) will do what you want.
Also, you can do some pretty complex layouts if you use GridBagLayout.

If you were set on FlowLayout, I guess you could get some control over
the arrangement in a FlowLayout by setting the size of the container
(the applet here).

> Also, if I create a new layout manager, how do I set it so that the
> applet takes on that layout manager? I tried
> setLayourManager(LayoutManager);  but it didn't do anything, all the
> components added to that manager didn't display.
>

The container method 'setLayout' is used to set the layout manager.

Also, You should be adding components to the applet rather than to the
manager.

  applet.setLayout ( new FlowLayout() ); // default anyway i think
  applet.add ( component );

Cheers,

Silent Knight.



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID: <7n6c93$ip0$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37968D90.C39CE214@unix.amherst.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10568c,2b96696819c6d6b2
X-Google-Attributes: gid10568c,public
X-Google-Thread: 10d6db,2b96696819c6d6b2
X-Google-Attributes: gid10d6db,public
X-Google-Thread: 10a146,2b96696819c6d6b2
X-Google-Attributes: gid10a146,public
X-Google-Thread: 11648c,2b96696819c6d6b2
X-Google-Attributes: gid11648c,public
From: Silent Knight <silent_knight71@my-deja.com>
Subject: Re: help with applet layout!
Date: 1999/07/22
Message-ID: <7n6c93$ip0$1@nnrp1.deja.com>
X-Deja-AN: 503884852
References: <37968D90.C39CE214@unix.amherst.edu>
X-Http-Proxy: 1.0 proxy83.edge.net.au:8080 (Squid/1.1.22), 1.0 x28.deja.com:80 (Squid/1.1.22) for client 203.166.242.43, 203.166.224.73
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Thu Jul 22 06:04:23 1999 GMT
X-MyDeja-Info: XMYDJUIDsilent_knight71
Newsgroups: comp.lang.java.programmer,de.comp.lang.java,fj.comp.lang.java,aus.computers.java
X-Http-User-Agent: Mozilla/4.61 [en] (Win98; I)