Absolute layout manager dimensions  
Author Message
Jan Krumsiek





PostPosted: 2005-10-26 5:18:00 Top

java-programmer, Absolute layout manager dimensions Hi again.

Is there any way to create a layout manager consisting of two cols where
the left has a width of 100px and the right one uses the rest of the
space available?

Something like HTML's <frameset cols="100,*"....>

Regards,
Jan
 
VisionSet





PostPosted: 2005-10-26 5:22:00 Top

java-programmer >> Absolute layout manager dimensions
"Jan Krumsiek" <email***@***.com> wrote in message
news:djm7dd$75i$email***@***.com...
> Hi again.
>
> Is there any way to create a layout manager consisting of two cols where
> the left has a width of 100px and the right one uses the rest of the
> space available?
>
> Something like HTML's <frameset cols="100,*"....>
>

Yes you can create your own LayoutManager to do whatever you like, not great
at making coffee though.
If you want a starting point from existing LayoutManagers, try a
BorderLayout using WEST and CENTER only, in WEST put a JPanel where you have
set preferredSize to have a width of 100px
Be sure you want to give explicit dimensions! Why do you want 100px?


 
Jan Krumsiek





PostPosted: 2005-10-26 5:30:00 Top

java-programmer >> Absolute layout manager dimensions VisionSet wrote:
> If you want a starting point from existing LayoutManagers, try a
> BorderLayout using WEST and CENTER only, in WEST put a JPanel where you have
> set preferredSize to have a width of 100px
> Be sure you want to give explicit dimensions! Why do you want 100px?

My application has a control panel (which shall 100px) and a plot area
where a graph is drawn... it shall use the rest of the available space.

Jan
 
 
VisionSet





PostPosted: 2005-10-26 5:44:00 Top

java-programmer >> Absolute layout manager dimensions
"Jan Krumsiek" <email***@***.com> wrote in message
news:djm84f$7bg$email***@***.com...
> VisionSet wrote:
> > If you want a starting point from existing LayoutManagers, try a
> > BorderLayout using WEST and CENTER only, in WEST put a JPanel where you
have
> > set preferredSize to have a width of 100px
> > Be sure you want to give explicit dimensions! Why do you want 100px?
>
> My application has a control panel (which shall 100px) and a plot area
> where a graph is drawn... it shall use the rest of the available space.
>

Then it is unlikely you want to fix size at all then.
You should use a fluid layout and use the layout mangers as they are
intended.
Your user decides the size of the window (or should do) and your application
should adjust its contents accordingly.
This is simplicity itself because there are enough layout managers to suit
99% of needs and that is there job.
You should invest some time suns layout manager tutorial for ex, will
quickly get you up to speed.

http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html

and especially

http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html


 
 
IchBin





PostPosted: 2005-10-26 5:54:00 Top

java-programmer >> Absolute layout manager dimensions Jan Krumsiek wrote:
> Hi again.
>
> Is there any way to create a layout manager consisting of two cols where
> the left has a width of 100px and the right one uses the rest of the
> space available?
>
> Something like HTML's <frameset cols="100,*"....>
>
> Regards,
> Jan

You can do this using JGoodies Forms. You can download the Freeware. I
love and use JGoodies forms and LAF Look libs for my Java apps.

http://www.jgoodies.com/freeware/formsdemo/index.html

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
 
IchBin





PostPosted: 2005-10-26 6:00:00 Top

java-programmer >> Absolute layout manager dimensions IchBin wrote:
> Jan Krumsiek wrote:
>> Hi again.
>>
>> Is there any way to create a layout manager consisting of two cols where
>> the left has a width of 100px and the right one uses the rest of the
>> space available?
>>
>> Something like HTML's <frameset cols="100,*"....>
>>
>> Regards,
>> Jan
>
> You can do this using JGoodies Forms. You can download the Freeware. I
> love and use JGoodies forms and LAF Look libs for my Java apps.
>
> http://www.jgoodies.com/freeware/formsdemo/index.html
>

A specific link for JGoodies Forms is..

http://www.jgoodies.com/freeware/forms/index.html

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
 
Roedy Green





PostPosted: 2005-10-26 6:53:00 Top

java-programmer >> Absolute layout manager dimensions On Tue, 25 Oct 2005 23:17:30 +0200, Jan Krumsiek <email***@***.com>
wrote, quoted or indirectly quoted someone who said :

>Is there any way to create a layout manager consisting of two cols where
>the left has a width of 100px and the right one uses the rest of the
>space available?

not a Layout but something that behaves much like one. See
http://mindprod.com/jsplitpane.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
Roedy Green





PostPosted: 2005-10-26 6:56:00 Top

java-programmer >> Absolute layout manager dimensions On Tue, 25 Oct 2005 23:17:30 +0200, Jan Krumsiek <email***@***.com>
wrote, quoted or indirectly quoted someone who said :

>Is there any way to create a layout manager consisting of two cols where
>the left has a width of 100px and the right one uses the rest of the
>space available?

When you are looking for a layout manager with certain properties,
check out my summary of them and what they do at
http://mindprod.com/jgloss/layout.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
Andrew Thompson





PostPosted: 2005-10-26 6:59:00 Top

java-programmer >> Absolute layout manager dimensions Jan Krumsiek wrote:

> Is there any way to create a layout manager consisting of two cols where
> the left has a width of 100px and the right one uses the rest of the
> space available?
>
> Something like HTML's <frameset cols="100,*"....>

</hackish psuedo-code>
// nested layout
JPanel theApplication = new JPanel(new BorderLayout());
JPanel theControlPanel = new JPanel() {
getPrefferedSize() {
return new Dimension(100,getHeight());
}
}
JPanel thePlotPanel = new JPanel();
theApplication.add( theControlPanel, BorderLayout.WEST );
theApplication.add( thePlotPanel, BorderLayout.CENTER );
<hackish pseudo-code>

I doubt your '100px' requirement though, if it contains
Java buttons and such, they should be in a layout, and the
panel should be able to tell you how much space it prefers.

HTH
 
 
Roedy Green





PostPosted: 2005-10-26 9:50:00 Top

java-programmer >> Absolute layout manager dimensions On Tue, 25 Oct 2005 22:59:09 GMT, Andrew Thompson
<email***@***.com> wrote, quoted or indirectly quoted someone
who said :

>I doubt your '100px' requirement though, if it contains
>Java buttons and such, they should be in a layout, and the
>panel should be able to tell you how much space it prefers.

But if you mean 100 pixels seriously, you can implement
getPreferredSize getMinimumSize and getMaximumSize or if in JDK 1.5+
use setPreferredSize etc.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.