problem: JToolBar in JMenuBar [message #56305] |
Wed, 18 August 2004 18:45 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: mb.thomas-daily.de
Hello!
I am using VE M2 on Eclipse 3 on Win XP.
When I add a JToolBar to a JMenuBar its not shown in VE. Why?
Sample Code:
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JToolBar;
/**
* @author SoftCulture
*/
public class ToolbarInMenuBug extends JFrame
{
private javax.swing.JPanel jContentPane = null;
private JMenuBar jJMenuBar = null;
private JMenu jMenu = null;
private JToolBar jToolBar = null;
private JButton jButton = null;
private JMenu jMenu1 = null;
public ToolbarInMenuBug ( )
{
super ( );
initialize ( );
}
private void initialize ( )
{
this.setJMenuBar (getJJMenuBar ( ));
this.setSize (300, 200);
this.setContentPane (getJContentPane ( ));
}
private javax.swing.JPanel getJContentPane ( )
{
if (jContentPane == null)
{
jContentPane = new javax.swing.JPanel ( );
jContentPane.setLayout (new java.awt.BorderLayout ( ));
}
return jContentPane;
}
private JMenuBar getJJMenuBar ( )
{
if (jJMenuBar == null)
{
jJMenuBar = new JMenuBar ( );
jJMenuBar.add (getJMenu ( ));
jJMenuBar.add (getJToolBar ( ));
jJMenuBar.add (getJMenu1 ( ));
}
return jJMenuBar;
}
private JMenu getJMenu ( )
{
if (jMenu == null)
{
jMenu = new JMenu ( );
jMenu.setText ("first menu");
}
return jMenu;
}
private JToolBar getJToolBar ( )
{
if (jToolBar == null)
{
jToolBar = new JToolBar ( );
jToolBar.setFloatable (false);
jToolBar.add (getJButton ( ));
}
return jToolBar;
}
private JButton getJButton ( )
{
if (jButton == null)
{
jButton = new JButton ( );
jButton.setText ("a button");
}
return jButton;
}
private JMenu getJMenu1 ( )
{
if (jMenu1 == null)
{
jMenu1 = new JMenu ( );
jMenu1.setText ("second menu");
}
return jMenu1;
}
}
|
|
|
|
Re: problem: JToolBar in JMenuBar [message #56337 is a reply to message #56326] |
Thu, 19 August 2004 07:46 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: mb.thomas-daily.de
Rich Kulp schrieb:
> A toolbar doesn't go in a menu bar.
Ehm, what do you mean? It runs. It's shown ...
> Technically the VE shouldn't of
> accepted a toolbar being dropped on a menubar.
Well, it doesn't.
I just put the code there and told him to synchronize.
thanx!
Marcus
|
|
|
Re: problem: JToolBar in JMenuBar [message #56353 is a reply to message #56337] |
Thu, 19 August 2004 12:02 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: mb.thomas-daily.de
Marcus Beyer schrieb:
> Rich Kulp schrieb:
>
>> A toolbar doesn't go in a menu bar.
>
>
> Ehm, what do you mean? It runs. It's shown ...
On the other hand: maybe it was just a sick idea ;-)
Marcus
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03720 seconds