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
3
votes
2 answers

Can you make a JToolBar undetachable?

I would like to make my JToolBar impossible to detach from its container but still let the user drag it to one of the container's sides. I know about public void setFloatable( boolean b ) but this won't allow the user to move the JToolBar at…
Vlad Topala
  • 896
  • 1
  • 8
  • 34
3
votes
1 answer

Make jtoolbar transparent

I have a jPanel with background and I want to add a JToolbar on it. My problem is when I add JToolbar its default background is bothering and I set it's opaque to false but has no effect. I want to remove it's default background and make it…
Iman
  • 1,017
  • 10
  • 26
3
votes
2 answers

JSeperator in JToolBar moves the components to right end

I am looking at Oracle's JToolBar code and trying to add JLabels within that toolbar. I have simulated the button-like feel for them by overriding the mouse events. It worked fine until I tried to add a JSeperator as I wanted a vertical line. I…
Dinesh
  • 16,014
  • 23
  • 80
  • 122
3
votes
2 answers

How to add gap between two buttons in JToolBar?

I need to add a simple gap/space/margin whatever to have space between these two buttons. Unfortunately I can't make it work. Could anyone give me some advice? It's based on BorderLayout, the buttons are in a JToolBar
user2061853
  • 627
  • 1
  • 7
  • 11
3
votes
1 answer

How to prevent toolbar button focus in Java Swing?

In my Java Swing application I am using a JToolBar with several buttons. After the toolbar object is being created I call setFocusable(false). However, every time I start the application the first button in the toolbar is focused. Any ideas how I…
Matthias
  • 9,817
  • 14
  • 66
  • 125
3
votes
2 answers

How to make a button selected by default in JToolbar

I created a small tool set which is composed of around 10 buttons. These buttons are added to a JToolBar. Currently, it puts a square around the first button by default; however, I would like a different button to be the default. How can I…
Pedrom
  • 378
  • 1
  • 5
  • 13
3
votes
2 answers

Does anyone know how to layout a JToolBar that doesn't move or re-size any components placed in it?

Can anyone help with this problem I'm trying to create a JToolBar and I want all its components to be fixed in size and position. I've tried a few different layout managers but they all center and/or re-size the components when the frame it's in is…
S1.Mac
  • 33
  • 1
  • 5
3
votes
1 answer

JToolbar control for all tabs on JTabbedPane

I want to have a JToolBar that have all the controls like add, edit, delete, save, etc on my java program. I want that toolbar to have control on all the panels that will be opened through my JTabbedPane. Is there a more convenient way to have the…
John
  • 836
  • 2
  • 25
  • 39
3
votes
1 answer

Resize component on JToolbar

I'm writing a program with a toolbar in the head. The only problem is that I can't set the correct size on the component in my toolbar, namely a datepicker. screenshot So I want to resize the datepicker in the toolbar. How can I fix this? The most…
Joël Craenhals
  • 475
  • 7
  • 19
3
votes
1 answer

Java JMenuBar : Vertical JSeparator

I'm trying to add a vertical JSeparator in my menu. But it puts margins between my MenuItems. I want my items to stay left instead of left - center - right. How it looks: What I want: JMenu settings = new JMenu("Settings"); image =…
Reinard
  • 3,624
  • 10
  • 43
  • 61
3
votes
3 answers

AbstractAction in JButton in JToolbar without text

My java swing app has some AbstractActions that are used in both JMenuItems and JButtons. I want to put some of them in a JToolbar inside a JButton, but I only want the icon to show, not the text. Is there a best practices way to do this?
user591568
  • 61
  • 2
  • 8
2
votes
1 answer

Placing an image within a jmenubar + jtoolbar

I would like to know if it's possible to set an image as background for a jmenubar+jtoolbar (not only for one of theym, not one for each of theym But on for BOTH) ... Anyone's got an idea ?? How should I do that if it's possible ? Thanks ! Here an…
Jsncrdnl
  • 3,005
  • 5
  • 28
  • 43
2
votes
1 answer

Transfer jtoolbar from one jpanel to another

This is my first question, so bear with me. Let's say that I have 2 JPanel and 1 JToolBar. What I want to do is drag the toolbar from one panel to another and, after mouse release, the toolbar should stick to the second.
Pantaziu Cristian
  • 882
  • 2
  • 14
  • 26
2
votes
2 answers

Swing JToolbarButton pressing

I use JToolbarButton button, I want to make it be "pressed" when I click on it, just like JButton works.How can I do this? Please help!Thanks.
Martin
  • 767
  • 2
  • 9
  • 21
2
votes
0 answers

JToggleButton inside JToolbar on macOS - no indication of being pressed

I can't seem to get simple toggle buttons working inside a JToolbar. This example program adds three toggle buttons in a button group to a JToolbar. On macOS, currenty toggled button is only visible if the app looses focus. import…
predi
  • 5,528
  • 32
  • 60
1
2
3
8 9