JMenu « Menu « Java Swing Q&A





1. Get rid of wasted/unused space in a JMenu    stackoverflow.com

In my app, I've got a menu bar with a File menu. In the submenus, each JMenuItem is wasting a lot of white space to the left of the text ...

2. JToolbar is hidden by JMenu    stackoverflow.com

I'm using Netbeans to add a JToolbar to my window which also has a JMenuBar. Here is the design-time look: alt text .. but during run-time I get this: alt ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>3. <a href='http://stackoverflow.com/questions/3875970/java-jmenu-on-left-side'>Java jmenu on left side</a><span class='articleProductElementHost'>    stackoverflow.com</span></h3><p class='articleProductElementParagraph'>In response to a recent <a href=slashdot post, I've decided I wish to add an option for menus to appear on say the left hand side so it doesn't obscure ...

4. JMenu Help to Open Html page on local machine    stackoverflow.com

I am having difficulty on finding a tutorial that enables a JMenuItem labelled ("Help Contents") to open a html page that displays help contents. The html page will be stored ...

5. Why isn't JMenu always on top?    stackoverflow.com

The JMenu behaves normally until a JButton is used to update a JTable on the JFrame. Then the JMenu is mostly hidden by a JPanel (see images below). Shouldn't the JMenu always be ...

6. Any existing java library to delete , edit , add certain line in a file with swing in Jmenu?    stackoverflow.com

I am now using Fileutils to access a file to retrieve lines of phone number. But now I need to add phone number , delete phone number and edit phone number ...

7. JMenu setDelay() pop down delay    stackoverflow.com

In my application, I have a JPopupMenu that displays a set of sub-menus:

private static JMenu createMenu(String title) {
    JMenu menu = new JMenu(title);
    menu.setDelay(2000);
  ...

8. Exception in JMenu    stackoverflow.com

I've developed an application in Java.. The problem occuring with it is that after first click, if the user clicks on menu again then following exception occurs.. Since it is showing that source ...

9. JPopupMenu and Jmenu problem    stackoverflow.com

I have a JPopupMenu lets call it (aaa) inside it i have Jmenu(mmm) ,contain some JmenuItems(like b,c,d,k). this popup menu shows at right click on the panel ,and on mouse over mmm ...





10. Swing JMenu problem    stackoverflow.com

Why I can't add JMenuBar to JToolBar, is it possible? Or I can only add menubar on frame?Tutorial says:

As the code shows, to set the menu bar for a ...

11. Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Rectangle width and height must be > 0    stackoverflow.com

I have a peculiar situation here in an application I've programmed using a Substance LookAndFeel. In my application, as seen in the screenshot below, I have three JMenus in the MenuBar. ...

12. JMenu Default Behavior    forums.netbeans.org

I am extremely new to NetBeans and Swing development in general, so bear with me if my question seems a bit obtuse. A have a JFrame, within which I've placed a ...

13. Bug or problem with JMenu?    forums.netbeans.org

Dear Netbeans users. I have some troubles with a Jmenu. If you make a project you have a standard menu with: File->close and Help->about. Normally I can edit the name of ...

14. JMenu    forums.netbeans.org

15. How to load classes from jmenu in application desktop    forums.netbeans.org

Hi dears, I'd like to know how to load jars from jmenu in Netbeans and if I have in a desktop application several entity classes with their respective main class, so how to call them from jmenu? because I tried the normal call (myclass m=new myclass(); m.setvisible(true); ) nothing happened. Please help

16. How can I add Jmenu to Jpanel, please help...    forums.netbeans.org





17. Help JMenu is getting frozen and won't go away    coderanch.com

I have an applet which spawns a JFrame that includes a JMenuBar with associated pop-up menus. If you pop a menu and then close the window with the X button, the menu is frozen in place and can't be dismissed (although it is active) when the window is resdisplayed. We're caching our windows, so they don't get destroyed until the entire ...

18. JMenu Problem    coderanch.com

19. JMenu always behind the Panel    coderanch.com

20. Dynamic building of Jmenu    coderanch.com

Hi Chhaya, Don't know if it will help. But here is a first pass on what I think you are trying to do. The code below works and might help your cause. import java.awt.*; import java.awt.event.*; import javax.swing.*; // // Demo for dynamically adding checkboxmenuitems. // public class JDynMenu extends JFrame implements ActionListener { private JMenu windowMenu; private int numWindows = ...

21. Using ItemListener on a JMenu    coderanch.com

22. JMenu and interaction    coderanch.com

23. JMenu    coderanch.com

I have created a menu. Whenever a menu item is selected, the previous displayed components will be set invisible, and the new components will be set visible. Suppose I have a menu button called, "Add". It has two menu items---"A Book" and "A CD". First I selected "A Book", then selected "A CD". Those displays are good. However, when I selected ...

24. JMenu    coderanch.com

I have never heard of any menu system that will display a sub menu when ALT + A + B is pressed. The way I have seen menus work, ALT + A will bring up the A menu. Pressing a B will bring up the B Sub-menu. Recently working with menus I found that Listeners are the way to implement most ...

25. JMenu hides behind components    coderanch.com

Look at this example... how does it compare with what's happening in your code... import javax.swing.*; import java.awt.*; public class LightweightTest extends JFrame { public LightweightTest() { JMenuBar menuBar = new JMenuBar(); JMenu menu = new JMenu( "Menu" ); menuBar.add( menu ); for ( int i = 0; i < 10; i++ ) { menu.add( new JMenuItem( "MenuItem " + i ...

26. Jmenu Dissappeared? hlp..eep    coderanch.com

I don't know what happened.. yeesh.. I'm starting to dislike Jbuilder and it's lack of complete control. I had a jmenu at one point, then I cut it and tried to paste it onto a panel..didn't work so I undid (Ctrl+Z) everything I had just done. Now, after this I also added a dialog window, and then I noticed that my ...

27. How to do actionPreformed and ations on a dynamic Jmenu ?    coderanch.com

Made this in VisualAge for Java 4.0 I have a StaevneContainer I create the JMenuItems from... the dynamic JMenu get created fine .. but how do I Make actionPreformed (see code example under to see what I mean) public void jMItemAdminStaevner_ActionPerformed(java.awt.event.ActionEvent actionEvent) { getJPOpretStaevne().setVisible(true); getJPAdminArbejds().setVisible(false); getJPAdminOfficial().setVisible(false); getJPDisciplin().setVisible(false); getJPAdminSpis().setVisible(false); getJBOpSt().setVisible(false); getJBRedigereSt().setVisible(true); getJBSletSt().setVisible(true); getJLabelOverskrift().setText("Administration af eksisterende stvne ("+aktueltStaevne.toString()+")"); getJLOpSt().setListData(new Vector(HDGSystemController.getStaevneCon().getStaevneContainer().getStaevner())); return; } and ...

28. Updating JPanel obscuring JMenu    coderanch.com

30. ButtonGroup in a jMenu    coderanch.com

Basically what i want to have is a button choice on the menu, in my example the application has 2 user types say Bob & Sue. So you can choose the Bob radio button in the menu and the Sue radio button will de-select. Assumed i'd need to set-up something with button groups!

31. JMenu Menu hiding behind JPanel    coderanch.com

32. JMenu layout, syntax error on variables    coderanch.com

Not wrong, no. I personally don't like to see that arrangement, but it's a style issue only. Generally any time you're writing a method that's 50 lines long, you ought to be looking for ways to break it up. Sometimes that does indeed mean using multiple classes, but here it probably just means using several methods in a single class. So ...

33. JMenu/Sub-menu creation    coderanch.com

Hi everyone! Her I am again, soliciting help, whilst I'm learning this new Java language. I'm trying to create a menubar. As my instructor insists on hard-coding everything, and not do any drag/drop methods, I tend to end up with so many problems. And here's one: the sub-menu has this right-pointing arrowhead (as if there's more sub-menu listing available). Here's a ...

34. about JMenu    coderanch.com

public class Example implements ActionListener { public static void main(String[] args) { ...//your code menuItem.addActionListener(this); //register all menuItems top ActionListener ....//your code } //override actionPerformed public void actionPerformed(ActionEvent e) { Object a=e.getSource(); if(a==menuItem){ //subroutine if this menu item was selected } if(a==//another menuItem) { //subroutine for this menuItem } ....... } }

35. JMenu    coderanch.com

36. JMenu + JPanel Problem    coderanch.com

37. How to add new tabs from JMenu    coderanch.com

I have a JMenu class (GoofyMenuBar.java) and a JTabbedPane class (LoginTabbedPane.java) that Im putting into a splitPane (SplitPane.java). Clicking on the Go button opens a new tab. I need to invoke the same action from the menu but somehow Im not making the connection between the components. Regardless of the ugliness, how can I invoke a method on JTabbedPane from the ...

38. JMenu n JToolBar problem    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Configuration { Search search; public Configuration() { search = new Search(); } private JToolBar getToolBar() { JToolBar toolBar = new JToolBar(JToolBar.HORIZONTAL); toolBar.add(search); JButton button = (JButton)toolBar.getComponentAtIndex(0); button.setIcon((ImageIcon)search.getValue(search.LARGE_ICON)); return toolBar; } private JMenuBar getMenuBar() { JMenu view = new JMenu("view"); view.setMnemonic(KeyEvent.VK_V); view.add(search); JMenuBar menuBar = new JMenuBar(); menuBar.add(view); return menuBar; } class Search extends ...

39. JMenu Problem    coderanch.com

Hello, Im having trouble with a a JMenu poping up in the following program, first off, I can sort of see the JMenu because very little box shows up that you can barely see. Also when add a blank component to the north parth of the content pane I can see the menu. There are 2 custom JPanels, one that lets ...

40. about JMENU    coderanch.com

41. Canvas + JMenu    coderanch.com

Hey all, I've spent enough time creating programs etc using just buttons and menus, and thought I'd spread my wings into the 2d graphics land. Thought for my first go I'd set up a simple "Paint" program, and ran into a little issue with the drawing canvas and JMenu's. I've got 2 classes (which are at the bottom of the post), ...

42. Scrolling JMenu    coderanch.com

Here's an idea: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ScrollingMenu { JMenu menu3; JPopupMenu popup; private JMenuBar getMenuBar() { JMenuBar menuBar = new JMenuBar(); menuBar.add(new JMenu("menu 1")); menuBar.add(getMenu2()); menuBar.add(getMenu3()); return menuBar; } private JMenu getMenu2() { JMenu menu = new JMenu("menu 2"); menu.getPopupMenu().setLayout(new GridLayout(0,9)); for(int j = 0; j < 100; j++) menu.add(new JMenuItem("item " + (j+1))); return menu; ...

43. Crazy behaviour of JMenu    coderanch.com

I am facing with a strange problem in JMenu.... I have a Swing application in which various menus are available. On selecting each menu item, different screens will be loaded.(through actionlistener). But when I try to select a particular menu item repeatedly, sometimes menu item which is ahed of currently selected menu item gets triggered and corrosponding screen gets loaded. So ...

44. JMenu problem    coderanch.com

this is just one of the ways import javax.swing.*; import java.awt.*; import java.awt.event.*; class Testing { public void buildGUI() { MenuItemListener listener = new MenuItemListener(); JMenu shapes=new JMenu("Shapes"); JMenuItem AAA=new JMenuItem("AAA"); JMenuItem BBB=new JMenuItem("BBB"); JMenuItem CCC=new JMenuItem("CCC"); AAA.addActionListener(listener); BBB.addActionListener(listener); CCC.addActionListener(listener); shapes.add(AAA); shapes.add(BBB); shapes.add(CCC); JMenuBar menuBar = new JMenuBar(); menuBar.add(shapes); JFrame f = new JFrame(); f.setJMenuBar(menuBar); f.setSize(400,300); f.setLocationRelativeTo(null); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } public ...

45. Adding JMenus to EditPanes    coderanch.com

Where is EditPane from? Is it a class you wrote yourself, or is it from some other source? (like jEdit, XMLMind, or JEditorPane?) If the component doesn't have some built in capability to handle menus (and I don't believe any of the ones I linked do...), you're going to have to add the menu and the editor to another panel, and ...

46. JFrame and JMenu    coderanch.com

import java.awt.Dimension; import java.awt.Font; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; public class ApplicationRx { // Expose frame as a member variable in class scope // so the ActionListeners can access it to call its // methods to make changes. JFrame frame; protected void createMainFrame(String title, Dimension dimension) { // create an instance of ...

47. JMenu Construction problem    coderanch.com

Hi folks, I have a problem with JMenu construction. Have a look at this code /** * @(#)MenuAdd.java * * * @author BALASUBRAMANIAN C * @version 1.00 2008/4/17 */ import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JMenuBar; import javax.swing.JFrame; import javax.swing.JPopupMenu; import java.awt.Dimension; public class MenuAdd extends JFrame{ private static MenuAdd m_menuAdd = new MenuAdd(); private JMenu fileMenu; private JMenuBar menuBar = new ...

48. JMenu Problem    coderanch.com

hello i got a little problem i never used jmenu before so i got this code for a simple menu and i want to add actions to the buttons exit, open, delete so i was wondering if anyone can show how to set for example the exit button to exit and so on thank you.JFrame jf =new JFrame("Collage Rooms"); jf.setSize(900,400); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ...

49. JMenu text color    coderanch.com

50. Jmenu display    coderanch.com

51. JMenu    coderanch.com

52. Putting JMenu into a Frame    coderanch.com

Hi Java Experts, I have a java.awt.Frame which I obtained from the SWT_AWT class in Eclipse. The problem is that I need to put my swing components into the available awt frame. One main problem is my JMenu which cannot possibly be displayed in the frame but I want it inside. Is there a solution to my problem? Thanks! Tim Berett ...

53. JMenu    coderanch.com

54. Does JMenu use Frames or Panels to draw menus?    coderanch.com

Essentially what I'm doing is writing an app that does not use MenuBar's, simply because they look outdated and old. So instead what I'm doing is popping up a Menu say from a custom drawn button. However I was wondering what everyone thought the best way to go doing this would be? My initial idea was to pop up a frame ...

55. making "Exit" option in JMenu    coderanch.com

given the various number of ways to close an app e.g. alt-F4, coffee cup icon menu/close, 'X' etc, you should: 1) put your confirm close action in a windowListener's windowClosing 2) set the frame to DO_NOTHING_ON_CLOSE 3) menuItem's exit to create/process a windowClosing event this way, however it is closed (turning off power excepted), you will be able to check if ...

56. JMenu Update    coderanch.com

I tried like you said ... but not working actually in my Gui class i have this Gui(){ this.setTitle("Acva Client Manager"); //this.setSize(1000, 1000); this.setExtendedState(MAXIMIZED_BOTH); // this put the JFrame size at the maximum of the screen size. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setContentPane(container); this.setJMenuBar(menuGui.setMenuBar()); // <--- here InitMenuLogin(); this.setVisible(true); } as you can see i call my setJMenuBar ... and my setMenuBar() method return ...

57. JMenu exit application problem!    coderanch.com

58. Invisible Jpanels with jmenu    coderanch.com

Hi. I am in need of help here. I making a aplication that are using menus. Every jMenuItem you click will get you a new jpanel with its items (buttons, labels). From what i have read i should be using Actionevent thing. But i cant make it work. Here is the code (part of the code). bog = new JMenu("Bog"); menuBar.add(bog); ...

59. JPopupMenu or JMenu - neither is quite what I'm after.    coderanch.com

When running that sample code I can't seem to see a popup menu, just the two menus at the top. http://img522.imageshack.us/img522/6218/menuk.jpg My code (below) works but the menu items don't highlight when I move the mouse over each menu item. final JPopupMenu popup; popup = new JPopupMenu(); JMenuItem menuItem = new JMenuItem("A popup menu item"); JMenuItem menuItem2 = new JMenuItem("A popup ...

60. JMenu trouble    coderanch.com

yes, i have created the menu correctly and done all that, but IN A DIFFERENT CLASS. how do i use that menu in the other class? i have tried to do frame.setJMenuBar(Menu.create()); but it comes up with non static method create() cannot be referenced from a static context. when i try and set the method create() to static it comes up ...

61. Clickable JMenu?    coderanch.com

62. How to add MouseLsitener to JMenu    coderanch.com

home.addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseClicked(MouseEvent e) { if(e.getSource() != null) { ...

63. JMenu help    coderanch.com

Hello all. I am currently working on creating a program to calculate a mortgage payment plan where the user enters the amount of the loan, and then uses the menu to choose the interest rate and term. For my last project I created a simple adding GUI which really helped me understand what was going on without having to worry about ...

64. Problem with JMenu.removeAll()    coderanch.com

Here's the code: ... final JMenu account = new JMenu("Account"); ... final JMenuItem login = new JMenuItem("Login"); final JMenuItem register = new JMenuItem("Register"); final JMenuItem logout = new JMenuItem("Logout"); ... account.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { account.removeAll(); //I remove everything and then populate the JMenu object... if(ds.getUsername() == null || ds.getPassword() == null){ //User isn't logged in so ...

65. JMenu with Tabs using swing    java-forums.org

Hello. I really need help in creating an interface with tabs and a menu bar kinda like this: XXX.java2s.com/Tutorial/JavaImages/AddButtonToTabBar.PNG but without the close button as all i need are tabs. I'm not too sure if i have to create another container. i.e. one for the menubar and one for my tabs. Or would an internal frame work? But i guess using ...

66. JMenu and JRadioButtonMenuItem    java-forums.org

67. Using a JMenu as a real option    java-forums.org

Hi, I'm setting up a menu where I have an "exit" menu on the right of the JMenuBar. I already tried to use a JMenuItem instead of a JMenu to do the job, but the L&F of the menu is different from a JMenu (the vertical gradient isn't draw) and I can't control its width. If I use a JMenu without ...

68. javax.media.Player and JMenu problem    java-forums.org

69. How to remove "unused" space in JMenu    java-forums.org

import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.UIManager; public class TestMenu extends JFrame { private static final long serialVersionUID = -6727171074713974942L; public TestMenu() { super("Test"); final JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new JMenuItem("Test #1")); popupMenu.add(new JMenuItem("Test #2")); addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { popupMenu(e); } @Override public void mouseReleased(MouseEvent e) { popupMenu(e); ...

70. Need JMenu help    java-forums.org

import java.awt.event.*; import java.awt.*; import javax.swing.*; public class menuTutorial extends JFrame { JMenuBar menuBar = new JMenuBar(); public menuTutorial() { setLayout(new FlowLayout()); JMenu file = new JMenu("File"); menuBar.add(file); JMenuItem exit = new JMenuItem("Exit"); file.add(exit); JMenu edit = new JMenu("Edit"); menuBar.add(edit); JMenuItem undo = new JMenuItem("Undo"); undo.add(undo); event e = new event(); exit.addActionListener(e); } public class event implements ActionListener { public void ...

71. problem with jmenu,please help!!!    java-forums.org

problem with jmenu,please help!!! public static void main(String[] a) { MyFrame win = new MyFrame(); win.start(); } private ShapeContainer _draws;Generics! private int _ink; private boolean _mark = true; private int _maxX,_maxY; private int _stage; private int[] _selected; private Point _p1,_p2; // tmp Points for selection private JTextField msgTf; // *** text area *** public MyFrame() { setSize(600, 500); _stage ...

72. problem with jframe&jmenu&graphics    java-forums.org

hi, from some reason my problem is delete in other post... i have two problems in my program with out exceptions : 1. when i run the code the shape that i create coen on my menu bar if i draw them near by... 2. when i draw shape near the menu and open the menu he erase from the screen ...

73. JMenu on Right side problem    java-forums.org

74. problem in setMnemonic for JMenu in JApplet    java-forums.org

Hi, I'm using this chunk of code below. setMnemonic works fine for JMenuItem but not for JMenu (although it does show the underline under the letter G it gives nothing when I press ALT G) I'm using Java 1.5_0_16 Thanks // Game menu gameMenu = new JMenu( "Game"); gameMenu.setMnemonic(KeyEvent.VK_G); // New Item newItem = new JMenuItem( "New"); newItem.setMnemonic(KeyEvent.VK_N); gameMenu.add( newItem);

75. link between two JFrame using JMenu    java-forums.org

Dont understand thanks for your reply bt i dont understand it. How do i create a cardlayout? let me post the application code i explained: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * StatsCalc.java * * Created on Jul 11, 2009, 12:22:47 PM */ package StatsCalc; import java.awt.event.ActionListener; ...

76. unwanted bug. JMenu    java-forums.org

Okey. Have nurfed it as much as i could. MainFrame Java Code: package shortpkg; import java.awt.Dimension; import java.awt.event.*; import javax.swing.*; /** * * @author ocean */ public class OrderMain { private JMenuBar mainMenuBar = new JMenuBar(); private JFrame mainFrame = new JFrame("Mst Order Program"); private JPanel mainPanel = new JPanel(); NewOrder newOrder = new NewOrder(); public OrderMain() { mainFrame(); } public ...

77. Applet in JFrame, JMenu problem    java-forums.org

public GUI(Applet app) { super("Title"); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); JMenuBar jmb = new JMenuBar(); // -- File -- JMenu file = new JMenu("File"); JMenuItem open = new JMenuItem("Open..."); open.setActionCommand("file-open"); open.addActionListener(this); JMenuItem reload = new JMenuItem("Reload"); reload.setActionCommand("file-reload"); reload.addActionListener(this); JMenuItem exit = new JMenuItem("Exit"); exit.setActionCommand("file-exit"); exit.addActionListener(this); file.add(open); file.add(reload); file.add(new JSeparator()); file.add(exit); // -- jmb.add(file); getContentPane().add(jmb); setJMenuBar(jmb); getContentPane().add(app, BorderLayout.CENTER); setSize(519, 394); ...

78. JMenu help    java-forums.org

the program was working fine until i added some menus. it showed no errors in the program itself but in the console these errors showed. Exception in thread "main" java.lang.NullPointerException at Converter.(Converter.java:54) at Converter.main(Converter.java:224) here is the code Java Code: import javax.swing.JFrame; import javax.swing.*; import java.awt.*; public class Converter extends JFrame { // menu JMenuBar bar; JMenu menu; JMenuItem resetapp; JMenuItem ...

79. JPanel not displaying after adding JMenu logic    java-forums.org

JPanel not displaying after adding JMenu logic I was able to get a version of this program working that just used a JPanel. I changed the logic to use JFrame so I could add a JMenu and display the panel, but the JPanel with my shapes isn't displaying now. Thanks for your help Java Code: // Filename: ColorChooserFrame.java // ...

80. jmenu dissapears when resizing frame    forums.oracle.com

81. Problem with JMenus    forums.oracle.com

82. need help about JMenu    forums.oracle.com

@corlettk: sorry about the previous post. I just figure out where the source of the problem is. In my application, i use javax.swing.Timer to make a clock and also do the later things. The application will repaint the clock (which is a JLabel) every 1 second. If i remove the paint method and delete the repaint () statement, the menu works ...

83. JMenu will not disappear    forums.oracle.com

I have a menu bar created through my netbeans IDE. I have added all the menu items and have events associated with the menu items. The problem i have is that i cannot get the menu to disappear unless i choose a specific item from it. For example, if i click 'File' and then click somewhere else in the window, the ...

84. Text component in JMenu    forums.oracle.com

In the future Swing related questions should be posted in the Swing forum. Here is a related question I raised years ago. In my example I was adding a panel containing a JTextField to a JPopupMenu. It works now but I don't know if the subtle change will work for you since you are using the SystemTray. [http://forums.sun.com/thread.jspa?forumID=257&threadID=528841] By the way ...

85. protected JMenu.paramString()    forums.oracle.com

Since the paramString() method is protected, it tells you that it wasn't meant to be called on JMenu instances -- so don't use it. If you study the JMenu API, you'll see that it subclasses JMenuItem which subclasses AbstractButton. I'd then use the getText() method from AbstractButton. When you do that, you'll see that your menu array hasn't been filled properly ...

86. Mirrored JMenu    forums.oracle.com

In the future, Swing related questions should be posted in the Swing forum. Get rid of the run() method. You should never have an infinite loop like that. Also, never invoke paint() directly. Use the repaint() method and let the Swing RepaintManager schedule repainting. I have no idea what you are attempting to do so I can't suggest an alternative.

87. Working with JMenu    forums.oracle.com

please go through the swing tutorial on creating and using menus. It will give you much more useful information then we can give here, as well as some great sample code. You can find it here: http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html Also, you have cross-posted this question here http://forum.java.sun.com/thread.jspa?threadID=5249326&messageID=10030298#10030298 and have not replied to messages posted here before posting this new question. This is generally ...

88. JMenu calling another Forms/Panels    forums.oracle.com

89. hey i got a few Q's about Jmenus    forums.oracle.com

first of is there a way for a menu to react only when pushed with left mouse button ? (in using an actionlistener for the menu) second, why dont i see a gray line (like where the menu items are for the entire length of that specific line) and last but not least , how does the shortcut keys system work ...

90. Gui- JMenu help    forums.oracle.com

I created a JMenu with JMenuItems with options like a regular menu on Microsoft word. I know the JMenuItem class has a method called "isSelected()". However, where should I call this method in my class in order for this option to work. For example, the "open" JMenuItem should display a GUI to find what file to open. I tried to put ...

91. Loading different frames using JMenu    forums.oracle.com

92. JMenu with clickable URL    forums.oracle.com

93. JMenu in Java Applications    forums.oracle.com

94. JMenu and GridBagConstraints    forums.oracle.com

95. JMENU and GRIDBAGLAYOUT    forums.oracle.com

96. checkable jmenu item    forums.oracle.com