Questions tagged [jmenu]

361 questions
0
votes
2 answers

JMenuItem updating without restarting the client

This code adds the user's favorited songs to a JmenuItem from an ArrayMap public void actionPerformed(ActionEvent evt) { String cmd = evt.getActionCommand(); if (cmd != null) { if (cmd.equalsIgnoreCase("Favorite song")) { …
Ravekitty
  • 77
  • 1
  • 14
0
votes
2 answers

Java: Using Multidimensional Arrays to Create Menubar

I'm trying to create a complete menubar using multidimensional ararys. So far I have this code: private JMenuBar menuBar = new JMenuBar(); private JMenuItem[][] menuItem = new JMenuItem[5][5]; private String[] menuBarItemNames = {"File", "Edit",…
obious
  • 609
  • 8
  • 21
  • 33
0
votes
2 answers

My JMenuBar not showing

I seem to have done everything correct, but it just cannot showing. Can anyone tell me why my menubar not showing? Can anyone help me???? public void go() { frame = new JFrame("Notepad"); //Font defaultFont = new Font("Candara", 10, 0); …
Tian Zhang
  • 13
  • 1
  • 3
0
votes
1 answer

JMenu Item to export jgraph as image

I have a jframe with a jgraph init, and I have added a jmenu bar. I am trying this code to add a jmenu item, so that when it is clicked it will export the jgraph as image in the selected location. I get the following errors: Exception in thread…
user2598911
  • 379
  • 2
  • 6
  • 22
0
votes
0 answers

Adding a jbutton in a jmenu that executes a different class

Not sure if what I am asking makes sense. But I have a class that has a jmenu, along with a jframe with a graph init. I would like to know if it is possible to add a jbutton as jmenu item, so that when it is clicked, it will run a different class .…
user2598911
  • 379
  • 2
  • 6
  • 22
0
votes
1 answer

Add Listener to a JMenuItem in a JFrame

I've a JFrame with a JMenuBar and JMenu in it. In ever JMenu there are several JMenuItem. I just want to add a listener to these JMenuItem, so when I click on one of it, something happens. The code is: public class FinestraOrario extends JFrame { …
Bernheart
  • 607
  • 1
  • 8
  • 17
0
votes
1 answer

How to align menu in a menu bar in Java Swing

In my application,i want to keep a menu bar and menus in the menu bar and i want to align the log out button to right side like in the image below. How can i achieve this?
koli
  • 194
  • 1
  • 6
  • 24
0
votes
2 answers

Is there a way to set underline to mnemonic character in native look and feel under Win 7?

My code: fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); fileMenu.setDisplayedMnemonicIndex(0); Javadocs for AbstractButton.setDisplayedMnemonicIndex() say that Not all look and feels may support this. I set my look and…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
0
votes
1 answer

How do I set the accelerator for a key within an Action?

I am trying to consolidate most of my menus in 2 similar applications that share a lot of classes. Part of this is I am trying to move anything I can into actions. The issue I am running into is I want the same accelerators for the menu items. Is…
davidahines
  • 3,976
  • 16
  • 53
  • 87
0
votes
1 answer

Jmenu rendering issue while loading

I am using Jquery Jmenu for Menu display.It displays as list view while loading page in IE8. After loading, few seconds later it displays as normal horizontal view. Whereas its working fine on Chrome browser. Please help on this. This is the css we…
Vandana
  • 79
  • 1
  • 12
0
votes
2 answers

java.lang.NullPointerException with JMenu and JMenuBar

I have a JMenuBar that has one menu and three JRadioButtonMenuItems: JMenuBar menuBar; JMenu menu = new JMenu("Menu"); JRadioButtonMenuItem rbMenuItem; I declare it: menu = new JMenu("A Menu"); ButtonGroup group = new…
DLJ
  • 333
  • 2
  • 6
  • 19
0
votes
1 answer

Java Swing JMenu Keeps Disappearing

Ok so trust me when I tell you that I have done my due diligence on this one. I've been trying to debug this for the longest time now and I've looked over the code again and again. I've checked Stack Overflow and nobody has had this problem. So I…
sourdesi
  • 360
  • 1
  • 4
  • 21
0
votes
1 answer

JPanel not adding in MenuSelected

My problem is that, this code is supposed to create a new button at the center when "Login" Menu is selected. When I select the menu, it prints "aaa" but does not add the button. How can I fix it? Thank you. public class NewJApplet extends JApplet…
0
votes
1 answer

How to add swing components that are outside of main file?

Example of my problem: I have a main file: public class APP extends JFrame { private Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); public APP() { setLayout(new BorderLayout()); …
B.K.
  • 9,982
  • 10
  • 73
  • 105
0
votes
0 answers

JPanel inside JFrame and Menu not losing focus

I have a JFrame with a JMenuBar, inside the JFrame there is a JPanel (the panel occupies all the space but the menu bar). The thing is that when I have the mouse over some MenuItem and move the mouse to the JPanel and do click, the menu should…
EricJ
  • 131
  • 3
  • 13