Questions tagged [jmenu]

361 questions
0
votes
1 answer

Suggestions with Notepad Program, JMenu, JPanel

I am stuck in building my Notepad. The problem is that when the user pushes the clear button, the program will ask the user if the user is sure to clear, if yes then the program will ask if the user wants to save the file before clearing, if yes…
0
votes
3 answers

My Menu Won't Show On My Sudoku Grid

I've made a board for a sudoku game but this one thing has got me stumped. It's late where i'm at and i've been working for a while and i cant find my problem. Would be nice if someone could point it out, thanks! import java.awt.GridLayout; …
0
votes
2 answers

How to rename submenu items?

I have a submenu populated with some actions, however the name that appears on them is not desirable. Instead of "Copy" and "Paste", I get the less desirable: copy-to-clipboard, paste-to-clipboard. I need to change that. //Submenu …
0
votes
1 answer

JTextArea, JMenuBar, JMenu, JMenuItem not showing up

I am quite new to Java so I need some help. I am trying to make a Notepad application. The problem is that none of my menus or textfield is showing up. I cannot figure out what the problem is. Please help. public class NotePad extends JFrame…
0
votes
2 answers

Opening a new container by clicking on a JMenuBar?

I created a window which contain a JMenuBar and I want to open another container when I click on a menu from my JMenuBar(by calling a new class, to separate each container by class). But I don't know how to do this. Actually I reset the currently…
Atnaize
  • 1,766
  • 5
  • 25
  • 54
0
votes
1 answer

JMenu wont appear in my jFrame

I cant see my JMenu in the frame when I run it, what should i do? I removed the panel where it was before, then i just want to put it in my frame package app.ui; import java.awt.Color; import java.awt.Font; import javax.swing.ImageIcon; import…
harraypotter
  • 111
  • 2
  • 2
  • 11
0
votes
1 answer

JOptionPane not showing up (null parameter, called from inner class)

I am completely new to JAVA, I am trying to make a simple application and there is no way I can get my JOptionPane to show correctly and I guess I am missing something: here's the code: import java.awt.Color; import java.awt.Window; import…
digne
  • 3
  • 2
0
votes
1 answer

JMenuBar not displaying right menu options

-I am trying to display GUI with menubar containing menus like "Open","Run","Help" but all I am able to see in GUI is menu "File" import java.awt.*; import java.awt.event.*; import javax.swing.*; import net.miginfocom.swing.MigLayout; public class…
0
votes
1 answer

JMenuItem-adding event listener

How can I handle adding JMenuItem (newItem) to the JMenu (menuUsers)? Is there a proper ActionListener for this purpose? There is a part of code that performs adding menu items to menu. It performs when some event is raised. Here it is: public void…
oler117
  • 89
  • 1
  • 8
0
votes
1 answer

How to Switch Jpanel on external class with JMenu on a JFrame

I'm trying to make a program with Java. It's Working with Jmenu and Jmenu item. My goal is to have a Jpanel for each Jmenu Item on external class. Netbeans have help me to make the basic of my menu... but I don't understand how I could use Jpanel…
0
votes
0 answers

Java: JMenuItem throws exception when clicked: IllegalComponentStateException

I'm trying to use a JMenuBar in my program, but every time the JMenuItem is clicked it throws an exception. I've made a very simple code snippet to explain how I am currently using JMenuBar, JMenu and JMenuItem: import javax.swing.*; public class…
Daniel Setréus
  • 552
  • 4
  • 16
0
votes
1 answer

JAVA Lost focus fom JMenu

This is my case, I have JMenubar and have CardLayout. In fact that I use JMenu to move for each card, so JMenus don't have any JMenuItem(It's some weird, huh?). I set for a button show a message, for example. The trouble is when I click on a JMenu,…
haind
  • 1,000
  • 2
  • 16
  • 28
0
votes
1 answer

Make .asm files in a folder as JMenuItems and add them to a JMenu, add ActionListener Events

lets say I have a folder called examples/basics/ In that folder I have a bunch of .asm files. What I would now like to do is to have those files automatically made into JMenuItems, without the .asm extension, placed inside a JMenu and have…
Makerimages
  • 384
  • 6
  • 27
0
votes
2 answers

Is it possible to remove a JMenuItem from a JMenu given only the String associated with the JMenuItem

I have a JMenu populated with JMenuItems from a database that have listeners, one of them being to delete the entry from the database if selected. When this happens that JMenuItem should disappear from the menus. Here's a short bit as an example for…
Michael Groleau
  • 81
  • 1
  • 2
  • 9
0
votes
1 answer

Giving JmenuItems loaded from a text file an action

I'm loading JmenuItems from a text file using this code FileInputStream wordsFile = new FileInputStream(signlink.findcachedir() + "/Playlist.div"); BufferedReader br = new BufferedReader(new InputStreamReader(wordsFile)); String[]…
Ravekitty
  • 77
  • 1
  • 14