Questions tagged [jmenubar]

Java swing implementation of a menu bar. JMenu objects are added to the menu bar to construct a menu.

263 questions
0
votes
2 answers

Java JMenuBar is not added or showing correctly

I am trying to add a subclass of JMenuBar to a user interface but for some reason it never shows up. I have tried using JFrame.setJMenubar() and JFrame.add(), i have tried adding it from within a SwingUtilities.invokeLater() call etc... It still…
Exevan
  • 335
  • 1
  • 3
  • 24
0
votes
2 answers

Drawn image inside panel seems to have wrong x,y offset

So, I have a JFrame with a menu, a toolbar and panel. I load images inside the panel but for some strange reason (to me at least) they are not correctly displayed in the panel. Sometimes they start under the toolbar, sometimes above. Furthermore the…
tagomago
  • 85
  • 1
  • 11
0
votes
1 answer

Is there some kind of way to make sub-menu items?

Say I had a JMenuBar. On that JMenuBar, I had a JMenu. On that JMenu, there was another menu, and on that menu, there were items. Is there a way to do this?
user1610406
  • 722
  • 1
  • 13
  • 24
0
votes
2 answers

Is it possible to move JMenuBar without adding it in a JPanel

I am facing a problem with my JMenuBar location in my Java application. I am actually using ComponentResizer.java code from the article. and everything with the resizing works fine except from the north area of my application (undecorated JFrame)…
PeGiannOS
  • 227
  • 4
  • 19
0
votes
2 answers

JMenu submenu little arrow icon indicator

Does anyone know how to control the display of the tiny little arrow that appears on submenus of JMenu? Can I change it? Can I disable it? Can I move it? Also, I notice that this arrow doesn't appear on top level JMenus only when they are submenus…
springcorn
  • 611
  • 2
  • 15
  • 28
0
votes
2 answers

disable JMenu flowing

While making some small app in swing I have encountered a little issue. I have a JMenuBar with few JMenus, some of which have MenuListeners added and they act like normal buttons (menuSelected opens a dialog). The problem is, when I click on a…
joval
  • 466
  • 1
  • 6
  • 15
0
votes
1 answer

How to make a Jbutton show a menuitem list?

Is there a way to show a menu item list when you click on a Jbutton? For example if I click on the Jbutton labelled wrench, it would show a menu item list with 2 options, like this example. Here's my code (the text emphasised with ** is the button I…
0x29A
  • 911
  • 1
  • 8
  • 13
-1
votes
1 answer

Java JMenu open upwards instead of downwards

I need to display a Java JMenu opening upwards instead of downwards. I am creating an application made of a series of JFames. One of those JFrames hosts a JMenuBar, built by a series of JMenu instances, and given the size and the position of this…
Morriz
  • 3
  • 2
-1
votes
1 answer

How to have a class which contains all the UI elements for a JFrame?

so i've got two classes one which handels creating the JFrame and the other that would load the menu bar on the JFrame the code is like this: import java.awt.Toolkit; import javax.swing.JFrame; import java.awt.Dimension; import…
-1
votes
1 answer

Getting a prompt from a JMenuItem

I'm trying to exit my application by choosing the exit-option in the menu bar, but I need to get a prompt before the program close. I have tried to find the answer here by reading similar questions, but many solutions just ends with…
Vicky123
  • 1
  • 3
-1
votes
1 answer

Error with JMenuBar (duplicates and overlaps)

I am making a window which contains, 1 JFrame and inside the JFrame contains a JMenuBar -> 3 JMenu -> Several JMenuItem in each JMenu ... inside the JFrame I also have several buttons and a JLabel. Well the problem that happens to me is that I put…
Jorge1023
  • 21
  • 4
-1
votes
1 answer

Why i'm getting a white area beside jmenubar?

I'm trying to create a dialog box which contains two splitPanel and a menu bar. Both of the splitPanel contain jlist. But when i run my code i get white area beside the menu bar .In the picture below a white area is created beside Organize. Here is…
IAmBlake
  • 457
  • 6
  • 21
-1
votes
1 answer

How to add a JMenuBar to a JTabbedPane?

I need to create a JMenuBar that will be shown under of JTabbedPane named as shapes. When I changed tab, menu bar will not be shown in the other tab. You can see what I mean from images. I created a menu bar and add it to JFrame but that is not I…
-1
votes
2 answers

JMenuBar isn't showing up

Does anyone of you have an idea why my JMenuBar menuBar isn't showing up? I'm using a JFrame and a JPanel. My class extends JPanel and has a paint method inherited (already with super.paint(g)). I want to display some JLabels and JTextFields on my…
Michael Gierer
  • 401
  • 2
  • 6
  • 15
-1
votes
3 answers

jMenuBar does not show any of its jmenuitems in swing

I have added some menu item in my menu bar in Swing. When I run the program, the menu bar does not show any JMenuItems, and instead throws a NullPointerException. When I create a menubar in AWT, it works just fine. I have not added any…
Ankush Tyagi
  • 63
  • 1
  • 1
  • 6
1 2 3
17
18