Skip to main content

JToolBar Orientation

2 replies [Last post]
scidocks
Offline
Joined: 2003-06-12
Points: 0

Would appreciate some help on this please...

What I want to have is a JToolBar with several buttons
on the East of a BorderLayout, so that the toolbar is
oriented from top to bottom. Without setting any Layout
explicitly on the JToolBar, when I tried the above,
the buttons run left to right ! If I, however, detach
the toolbar and reattach it, then it looks nicely
top to bottom ordered.

You can test this out with the ToolBarDemo.java that
comes along with the Sun's Swing Tutorial - replace
BorderLayout.NORTH with EAST at design time and
launch.

Thanks in advance for any ideas...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Scott Violet

Scidocks,

JToolBar has a setOrientation method, have you tried setting that?
The default is HORIZONTAL, which is what you are seeing.

-Scott

On Wed, Jan 28, 2004 at 03:32:10AM -0500, swing-feedback@javadesktop.org wrote:
> Would appreciate some help on this please...
>
> What I want to have is a JToolBar with several buttons
> on the East of a BorderLayout, so that the toolbar is
> oriented from top to bottom. Without setting any Layout
> explicitly on the JToolBar, when I tried the above,
> the buttons run left to right ! If I, however, detach
> the toolbar and reattach it, then it looks nicely
> top to bottom ordered.
>
> You can test this out with the ToolBarDemo.java that
> comes along with the Sun's Swing Tutorial - replace
> BorderLayout.NORTH with EAST at design time and
> launch.
>
> Thanks in advance for any ideas...
> ---
> [Message sent by forum member 'scidocks' (scidocks)]
>
> http://www.javadesktop.org/forums/thread.jspa?messageID=6283&#6283

scidocks
Offline
Joined: 2003-06-12
Points: 0

Thanks much Scott.
I need to be tarred, feathered....and made to read the
manual more often :) Project deadlines can do strange
things to one's sanity..

> Scidocks,
>
> JToolBar has a setOrientation method, have you tried
> setting that?
> The default is HORIZONTAL, which is what you are
> seeing.
>
> -Scott
>
> On Wed, Jan 28, 2004 at 03:32:10AM -0500,
> swing-feedback@javadesktop.org wrote:
> > Would appreciate some help on this please...
> >
> > What I want to have is a JToolBar with several
> buttons
> > on the East of a BorderLayout, so that the toolbar
> is
> > oriented from top to bottom. Without setting any
> Layout
> > explicitly on the JToolBar, when I tried the above,
> > the buttons run left to right ! If I, however,
> detach
> > the toolbar and reattach it, then it looks nicely
> > top to bottom ordered.
> >
> > You can test this out with the ToolBarDemo.java
> that
> > comes along with the Sun's Swing Tutorial - replace
> > BorderLayout.NORTH with EAST at design time and
> > launch.
> >
> > Thanks in advance for any ideas...
> > ---
> > [Message sent by forum member 'scidocks'
> (scidocks)]
> >
> >
> http://www.javadesktop.org/forums/thread.jspa?messageI
> D=6283?