java - How to rename submenu items? -


I have submenu of population with some actions, even though names that appear on them are not desirable "copy" and "paste "Instead, I get less desirable: copy-to-clipboard, paste-to-clipboard. I need to change it.

  // submenu submenu = new gmailine ("paste"); MenuOptions.add (submenu); Action LessonCopy = New DefaultEditorKit.CopyAction (); Action Lesson Paste = New DefaultEditorKit.PasteAction (); // Copy SubMenu.add (textActionCopy); // Paste submenu.ed (TextActionPaste);  

Add more actions about how to create a MenuItem, then add it to the menu. < / P>

Sample:

  // submenu submenu = new gemen ("paste"); MenuOptions.add (submenu); Jenemitum cut = new gemenuitem (new default editor.cut action) ()); Jenemytim copy = new jmuiteum (new default editor.capaigne ()); Gemmenitum Paste = new gemenuitem (new default editor.pet action); Submenu Ed (cut); paste.setText ("Paste"); Cut.setText ("cut"); copy.setText ("Copy"); Submenu .add (copy); Submenu .add (paste);   

Also follow the Java Conventions for variable names

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -