Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » problem: JToolBar in JMenuBar
problem: JToolBar in JMenuBar [message #56305] Wed, 18 August 2004 18:45 Go to next message
Eclipse UserFriend
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 #56326 is a reply to message #56305] Wed, 18 August 2004 21:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

A toolbar doesn't go in a menu bar. Technically the VE shouldn't of
accepted a toolbar being dropped on a menubar.


--
Thanks, Rich Kulp

Re: problem: JToolBar in JMenuBar [message #56337 is a reply to message #56326] Thu, 19 August 2004 07:46 Go to previous messageGo to next message
Eclipse UserFriend
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
Eclipse UserFriend
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
Re: problem: JToolBar in JMenuBar [message #597398 is a reply to message #56305] Wed, 18 August 2004 21:11 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

A toolbar doesn't go in a menu bar. Technically the VE shouldn't of
accepted a toolbar being dropped on a menubar.


--
Thanks, Rich Kulp

Re: problem: JToolBar in JMenuBar [message #597411 is a reply to message #56326] Thu, 19 August 2004 07:46 Go to previous message
Marcus Beyer is currently offline Marcus BeyerFriend
Messages: 37
Registered: July 2009
Member
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 #597417 is a reply to message #56337] Thu, 19 August 2004 12:02 Go to previous message
Marcus Beyer is currently offline Marcus BeyerFriend
Messages: 37
Registered: July 2009
Member
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
Previous Topic:problem: JToolBar in JMenuBar
Next Topic:Is there any easy way to disable the "visual nature"?
Goto Forum:
  


Current Time: Tue Jul 16 07:46:51 GMT 2024

Powered by FUDForum. Page generated in 0.03926 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top