jtoolbar

How can I create a "Drop-Down" menu in a Java Swing toolbar?

I've created a drop-down menu on my Swing JToolBar. But it doesn't create behave the way I want. I'm aiming for it to work like Firefox's "Smart Bookmarks" button. It disappears when the user selects a menu item: CORRECT! It disappears when the user presses ESC: CORRECT! It disappears when the user clicks somewhere in the main frame o...

JToolbar background image

I'm using a customized JToolbar using the following code: public class GeneralToolbar extends JToolBar{ public GeneralToolbar() { super(); setBackground(Color.white); setOpaque(true); setPreferredSize(new Dimension(54,54)); setMinimumSize(new Dimension(54,54)); setMaximumSize(new Dimension(54,54)); setSize...

how to remove item from jtoolbar

private JButton btnTask = new JButton(); ... TaoGlobal.taskbar.add(btnTask); How to remove btnTask from JToolBar? Thanx. ...

changing jtoolbar images when JMenuItem is clicked

Hi, I need to develop a swing application with a menubar. When a menu is clicked, I have to display the menu items as icons in one bar. Same like when another menu is selected, corresponding menu items should be displayed in the bar. How can I achieve this functionality using Swings? Any help would be appreciated. Thanks in Advance, M...

BorderLayout problem with JSplitPane after adding JToolbar (Java)

Hello all. Problem: My program layout is fine, as below before I add JToolbar to BorderLayout.PAGE_START Here's a screenshot before JToolbar is added: Here's how it looked like after adding JToolbar: May I know what did I do wrong? Here's the code I used: //Create the text pane and configure it. textPane = new JTextPane()...

JToolbar is hidden by JMenu

I'm using Netbeans to add a JToolbar to my window which also has a JMenuBar. Here is the design-time look: .. but during run-time I get this: With the toolbar seemingly partially hidden under the menu names. This is on the Mac, btw. Is there something stupid I've forgotten to do or some layout trick I should be using? EDIT: I'll ad...

How to remove gap between controls in JToolBar?

How to remove gap between controls in JToolBar? I want to have no free space between controls in JToolBar. EDIT: I was wrong. There is no free space. The problem is caused by JButton (situated in JToolBar) with icon only. It has some extra margins around the icon. How to remove them? ...

Why is addSeparator() not working with my JToolBar?

Hey all, I am having trouble getting a JSeparator to show up inside of a JToolBar. My toolbar is created as follows : public class ToolBar extends JToolBar { super(); FlowLayout layout = new FlowLayout(FlowLayout.LEFT, 10, 5); setLayout(layout); add(new JButton("Button 1")); addSeparator(); add(new JButton("B...

How can I let JToolBars wrap to the next line (FlowLayout) without them being hidden ty the JPanel below them?

I am in the process of making a GUI which shows three JToolBars above a big JPanel. These toolbars are collectively very large, so I'm using a FlowLayout to make them wrap to the next line if they reach the JFrame border. The problem is that when they wrap to the next line, they become hidden by the JPanel below.. I wish I could force th...

JToolbar doesn't show on Ubuntu if set to BasicToolBarUI

Hi, I've decided to have my own custom UI of JToolBar by subclassing BasicToolBarUI, as part of my Swing program. It works great under OS X (10.6) and Windows (7), but when it comes to Linux, problem occurs: If the swing component is Using SystemLookAndFeel (With Java LAF it is shown) Using UI BasicToolBarUI (To simplify the problem...