1. How can I determine which menu item called an ActionListener? stackoverflow.comI have a Java program where I have a JMenu with an arbitrary number of items (in this case, there is one menu item for each dynamic library currently loaded in ... |
2. How to deactivate a method for a specific menuItem? stackoverflow.comI want to check somehow which MenuItem was selected, so that for some menu buttons to draw a grid in a different way. I have the menu created in the package view, ... |
3. JMenuItem problem. I have five. One of them compiles with no problem. The others are identical, yet they refuse to compile stackoverflow.comfor some reason, I am unable to compile this in Eclipse. The "quit" menuItem works and no other menuItem works. Why is that?
|
4. How to detect mouse click on menuItem when added via addMouseListener stackoverflow.comConsider you want to close your java application using "Close application" menu item. 3 possible solutions are (using ActionListener or MouseAdapter or MouseListener):
|
5. how to write functions for MenuItems coderanch.com |
7. How to Drag a MenuItem and add to JPane?? coderanch.com |
8. Integrating menuItem and JButton coderanch.comclass MyFrame extends JFrame { private Action a = getAction(); /// some action object private JCheckboxMenuItem mItem = new JCheckboxMenuItem("Menu"); private JToolBar toolBar = new JToolBar("toolbar"); public MyFrame(){ toolbar.add(a); } } My question is that is there anyway to fire action object when menuItem's state is changed? The menuItem and toolbar button for that action perform same task so they must ... |
9. how to change the icon of an menuitem's action coderanch.com |
10. How to notify a MenuItem I have change its properties? coderanch.com |
11. MenuItem coderanch.com |
12. How to remove menuitem from context menu (SWT) coderanch.comhi everybody can someone tell me how i can remove a menuitem from a context menu or even better how i can clear all items from a menu (like resetting the menu). i couldn't find any remove method or so. depending on the selected item i want different entries in my context menu. any ideas? regards |
13. Have all menuitems in own class coderanch.comimport java.awt.*; import javax.swing.*; class MyFrame extends JFrame { public MyFrame() { setTitle(""); setSize(500,300); setLocationRelativeTo(null); setJMenuBar(new MyMenuBar()); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ new MyFrame().setVisible(true); } }); } } class MyMenuBar extends JMenuBar { public MyMenuBar() { JMenu fileMenu = new JMenu("File"); fileMenu.add(new JMenuItem("Open")); add(fileMenu); } } |
14. menuitems coderanch.com |
15. How to add different menuitems to child node coderanch.comHi All, I have 2 Swing files 1 is Sync7000_SubChildConfTool.java (main file) and 2nd file is SerialPortSubChild.java. After running the main file SYNC7000 (root node) will display. If i right click on this root node i am getting 4 menu items (Add Serial Channel, Add Optical Channel, Add TCP/UDP Channel, Add Modem Channel) in popup. If i right click on that ... |
16. JDesktopPane creates inner frame menuItem actionPerformed does not. coderanch.comHello could someone help me figure out how to make my menu item work? It calls createFrame() to add an additional inner frame. It runs but nothing is added to the JDesktopPane. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package application1; import guide.Guide; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Toolkit; ... |
17. Regarding MenuItem coderanch.com |
18. How to set Icon on MenuItem coderanch.com |
19. MenuItem eventhandling coderanch.com |
20. Strange MenuItem Behaviour coderanch.comWhen resetting text in my JMenuItem there seems to be white space at the end of the text, even though I have not included it in the text itself. The text starts out alright, it is changed to suit the function, but when changed back to the default menuitem text, it seems longer than the origianl. I have tried using revalidate() ... |
21. MenuItem font setting coderanch.comThanks for the responses, The given links contain, the exact problem i am facing. I have expected the swing version of tray icon in jdk7. After the release of JDK7 i have searched javadocs interestingly for that component. Here my application perfectly runs in ubuntu linux with all unicode characters displaying. But of course the look and feel is motif, so ... |
22. jmenubar,menuitem coderanch.comMichael Dunn wrote:> sir i have a problem probably just me, but your desciption gives me no idea what the problem is. if you post your code and explain what it does do vs what you want it to do, we/i might get a better grasp of the problem. ok sir just wait i am sending my code package hospital; import ... |
23. How to add different menuitems to child node java-forums.org09-11-2009 12:39 PM #1 sudhakar.cheru Member Join Date Sep 2009 Posts 2 Rep Power 0 How to add different menuitems to child node Hi All, I have 2 Swing files 1 is Sync7000_SubChildConfTool.java (main file) and 2nd file is SerialPortSubChild.java (it has only 5 ComboBox fields and ok and cancel button). After running the main file SYNC7000 (root node) ... |
24. How to create ActionListners for dynamically created MenuItem? java-forums.orgHi Friends, I have to create menuitems dynamacally. I need help regaurding with how to create actionlistner for this menu item. my code is for (int i = 0; i < scanEntryList.size(); i++) { scanTmpl = (Notice) scanEntryList.get(i); //String senderid = scanTmpl.senderId; notices = new MenuItem(scanTmpl.senderId + ":" + scanTmpl.subject); ActionListener actionOnNoticeListner = new ActionListener() { public void actionPerformed(ActionEvent e) { ... |
25. How to enable MenuItem Onclicking handeling in this case java-forums.orgpublic class test extends Frame implements ActionListener { public static void main(String[] args) {new test();} test() { super("Rubik's Cube"); MenuBar mb; Menu m1; MenuItem mi1_1,mi1_2,mi1_3; addWindowListener(new WindowAdapter() {public void windowClosing( WindowEvent e){System.exit(0);}}); //Build the menu bar mb = new MenuBar(); setMenuBar(mb); //Build menus in the menu bar m1 = new Menu("Menu 1"); mb.add(m1); mi1_1 = new MenuItem("initialise"); m1.add(mi1_1); mi1_2 = new ... |
26. user enable MenuItem java-forums.orgHi, guys! I'm programming to solve a 3X3 Rubik's Cube using Evolutionary Algorithm. Now there's another problem with GUI. I want to enable MenuItem mi1_3 (back) after MenuItem mi1_1(initialise) is clicked. Thanks! The structure of my program: Java Code: public class test extends Frame implements ActionListener { public static void main(String[] args) {new test();} test() { super("Rubik's Cube"); AnimCube obj = ... |
27. Connect MenuItem to status bar text java-forums.orgHi all, I have an application with a JMenuBar. To every MenuItem I added a MouseListener that will change the status bar text to show a description of the MenuItem. I'd like to have this behavior also when navigating the menu with the keyboard. I have no idea how to do it as a KeyListener won't provide the functionality needed. Your ... |
28. JPopupMenu question: Can I get the parent menuItem name? forums.oracle.com |