Re: setting size of elements



On Sat, 27 Aug 2005 11:21:12 -0400, Frances wrote:

> Andrew Thompson wrote:
>> On Sat, 27 Aug 2005 08:46:59 -0400, Frances wrote:
>>
>>>setSiz() is ignored...
>>
>> In deference to preferredSize, mostly.
...
>>>getContentPane().add(btn);
>>> btn.setSize(80,20);
....
>> Yes. The default layout of Swing root containers is BorderLayout,
...
....
>> Have you done the layout tutorial and Swing tutorials
>> mentioned in the GUI FAQ?
>
> ...I have read up on this stuff more than you think...

Which leads to the next question. What in those tutorials
is unclear? Specifically, and one thing at a time..

>..I need to do my applet in swing b/c I need a SplitPane,
> which you can't do in AWT...

AWT does not provide a JSplitPane, no.

My point was not about AWT/Swing, it was about applet/JApplet,
it was about split SplitPane/JSplitPane*. In the specific
instance your were mentioning, the default behaviour of an
Applet and JApplet is quite different. For example, they
have different default layouts.

So, please avoid old habits and instead be *specific*,
and *exact*.

* And there is no such class as a SplitPane. Why
do you make the reader guess what you are doing?
Do you think that makes it more 'fun' for them?

>..I did manage to do a split pane, but even though I specify rows
> and columns for each TextArea in each ScrollPane inside the SplitPane,
> the top half comes out tiny (less than one row..) the button I have
> underneath is same size as SplitPanel..

OK.. Where is your SSCCE?

> I'm going a bit crazy here..

Yes. I noticed.

Again you are tending to pour out a great long series
of breathless questions.

I snipped them.

It seems you have some basic misunderstandings about
how to use layouts, and we need to sort them one at
a time.

However, I will give you one more tip this post.

> if you use GridLayout (rows and columns) can u tell it what to put in
> what rows and in what columns? if so I haven't found it yet...

It depends purely on the *order* in which the components
are added. Try adding 16 (20 ..50) labels with text
"Label nn" to a GridLayout one at a time and it will
become very obvious.

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Where I'm going next, I'm goin' alone.."
Paul Kelly 'Deeper Water'
.