Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
JToolBar in Swing
- From: shvets@xxxxxxxxxxxxx (Alexander G. Shvets)
- Subject: JToolBar in Swing
- Date: Fri, 29 Oct 1999 23:46:21 +0300
Hi, Makarand!
You can simply add new elements to toolbar. If you wish to have some control
over appearance of it, try to use some free spaces between components like
here:
toolBar.add(Box.createRigidArea(new Dimension(10, 20)));
The following code set given component at right side of toolbar:
JPanel emptyArea = new JPanel();
toolBar.add(emptyArea);
toolBar.add(lastComponent);
It's my own experience.
Alexander.
Makarand Kashikar wrote:
> I think my Q was not clear...
> Let me refrase it.
>
> I am talking about the layout manager for the JToolBar
> and not for the JFrame which holds the JToolBar.
>
> I am having problems placing a JComboBox within the JToolBar...
>
> Makarand
> ----- Original Message -----
> From: Alexander G. Shvets <shvets@xxxxxxxxxxxxx>
> To: Makarand Kashikar <Makarand.Kashikar@xxxxxxxxxxxx>
> Cc: <advanced-java@xxxxxxxxxxxxxxxx>
> Sent: Friday, October 29, 1999 12:24 PM
> Subject: Re: JToolBar in Swing
>
> > JToolBar works correctly only with BorderLayout - it shoud be placed on
> > perimeter of frame ;-(. Otherwise you cannot extract it and insert in new
> > position.
> >
> > Alexander.
> >
> > Makarand Kashikar wrote:
> >
> > > This is a swing related Q, so Forgive me if some people did not welcome
> it.
> > >
> > > What is the Layout manager does the JToolBar uses.
> > > Is there a way to setting it to null ?
> > >
> > > When I place a JComboBox the combo box is streatched all over the
> JToolBar.
> > > It is very frustrating as I have to add this JToolBar to a JFrame and
> the
> > > JToolBar
> > > takes the width equals to the JFrame and so does the JComboBox...
> > >
> > > Makarand
> > >
> > > ---
> > > To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
> > > To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
> >
> >
---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- References:
- JToolBar in Swing
- From: Makarand Kashikar
- JToolBar in Swing
- From: Alexander G. Shvets
- JToolBar in Swing
- From: Makarand Kashikar
- JToolBar in Swing
- Prev by Date: classloader
- Next by Date: FW: Start java app with an exe
- Previous by thread: JToolBar in Swing
- Next by thread: JToolBar in Swing
- Index(es):