Questions tagged [jtoolbar]

refers either to Joomla JToolBar or Java Swing JToolBar.

Java Swing JToolBar provides a component that is useful for displaying commonly used Actions or controls.

Joomla JToolBar is a component for creating a HTML toolbar on the site.

132 questions
18
votes
2 answers

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…
Shawn
  • 10,931
  • 18
  • 81
  • 126
14
votes
4 answers

JAVA: Ways to fill a Frame. add(), setContentPane(), getContentPane()

I found three ways to fill my JFrame frame = new JFrame("...") createContentPanel returns a JPanel and createToolBar returns a ToolBar. frame.add(this.createToolBar(), BorderLayout.PAGE_START); //this works and puts the ToolBar above and the…
froehli
  • 141
  • 1
  • 1
  • 4
9
votes
1 answer

Certain FontAwesome glyphs don't render in Java Swing JToolBar buttons

I'm having a problem displaying certain glyphs from the FontAwesome collection in buttons in a Swing JToolBar. Here is a screenshot to illustrate (notice that the top button in the toolbar on the right hand side is not a nice icon but instead shows…
David Gilbert
  • 4,427
  • 14
  • 22
9
votes
4 answers

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…
Steve McLeod
  • 51,737
  • 47
  • 128
  • 184
6
votes
1 answer

How to disable dragging of JToolbar?

How to disable dragging of JToolbar? I placed it in a BorderLayout. I tried finding a method. Is there such a method ? THanks
Philip Morris
  • 459
  • 1
  • 9
  • 26
5
votes
2 answers

JToolbar Insert Left and Right

I created a JToolbar component and added it to a Frame. The toolbar uses the BorderLayout. I add three buttons to the toolbar and they show just fine except I want them to be added to the right side of the toolbar. Right align. Then whenever I add…
Brandon
  • 22,723
  • 11
  • 93
  • 186
4
votes
2 answers

Creating a composite Swing component for JToolbar

When using setRollover(true), buttons on Swing toolbars are flat without border and the border is drawn only when hovering/pushing the button. However, if the buttons are first added to a panel, and then the panel is added to the toolbar, this does…
Jirka
  • 4,184
  • 30
  • 40
4
votes
2 answers

Java Swing: How JToolbar changes appearance of a button?

When you add a JButton to a JToolbar, the button takes a specific look (not the same that if you add it to a Jpanel). I created some component similar to a JToolbar and I would like the same behavior. Problem: I checked the JToolbar class to find…
paranoia25
  • 626
  • 1
  • 5
  • 23
4
votes
2 answers

How to make an auto-hide the JToolBar?

I'd like to make an auto-hide the JToolBar and it appear only when the mouse goes near/over the JToolBar. I have added the JToolBar in JPanel. There is no mouseover listener in JToolBar. How to do this?
bharath
  • 14,283
  • 16
  • 57
  • 95
4
votes
1 answer

Is there a way to find which region BorderLayout has docked a user draggable JToolBar

I have user draggable JToolBars added to the NORTH, EAST and WEST regions of a JPanel with a BorderLayout. When the app exits I would like to save the region that the user has docked the JToolBars to, in order to respect this preference on next app…
Hamish258
  • 305
  • 2
  • 9
4
votes
3 answers

JPanel doesn't update when adding Component in another class

I'm fairly new to Java Swing and I'm running into a few problems. As a side question, when making a fairly large Java Swing Application, what is the best way to split up code? In my case I want to have an application that has a layout just as…
Toast
  • 111
  • 1
  • 9
4
votes
2 answers

How to add JToolBar in center of JPanel ,Java Swing?

I am new to Java Swing.I want to design one JToolBar. The JToolBar should be placed in center of JPanel. Is it possible? javax.swing.JPanel pane = new javax.swing.JPanel(); BorderLayout border = new BorderLayout(); pane.setLayout(border);…
boopathy
  • 427
  • 2
  • 9
  • 20
4
votes
1 answer

NetBeans Platform: Toolbar and Actions

I have been trying to solve this for the past 2 days with no luck. I went through pages upon pages of solutions that all look correct, but either my implementation is wrong or they aren't they right solutions. I have created a new Toolbar called…
Metal Wing
  • 525
  • 1
  • 11
  • 22
3
votes
2 answers

Setting a specific location for a floating JToolBar

I want to set a specific location to a JToolBar when I launch the Application. Is there any way to set the floating location of a JToolBar on a specific Point on the screen? I have this code as example which will create a Toolbar and tries to set it…
Marius Manastireanu
  • 2,461
  • 5
  • 19
  • 29
3
votes
3 answers

Why is addSeparator() not working with my JToolBar?

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); …
Hamy
  • 20,662
  • 15
  • 74
  • 102
1
2 3
8 9