|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCutCopyPasteTest
Class CutCopyPasteTest illustrates basic cut, copy, and paste operations between two text fields. The cut, copy, and paste commands are on a pulldown menu. The cut and copy commands take text from the left text field. The paste command pastes the cut or copied text into the right text field.
Field Summary | |
protected static javax.swing.JTextField |
field1
Field 1, from which text is cut and copied |
protected static javax.swing.JTextField |
field2
Field 2, into which text is pasted |
protected static javax.swing.JMenu |
menu
The Edit menu with Cut, Copy, and Paste items |
protected static javax.swing.JMenuBar |
menubar
The menu bar with the Edit menu |
protected static javax.swing.Box |
textFields
The two text fields box |
Constructor Summary | |
CutCopyPasteTest()
|
Method Summary | |
protected static void |
composeMenu()
Compose the menubar, menu, and items. |
protected static void |
composeTextFields()
Compose the text fields. |
static void |
copy()
Copy text from field1 to system clipboard. |
static void |
cut()
Cut text from field1 to system clipboard. |
static void |
main(java.lang.String[] args)
Create menubar, text fields and buttons and display in a JFrame; see code body comments for details. |
static void |
paste()
Past cut or copied text from system clipboard to field2. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static javax.swing.JMenuBar menubar
protected static javax.swing.JMenu menu
protected static javax.swing.JTextField field1
protected static javax.swing.JTextField field2
protected static javax.swing.Box textFields
Constructor Detail |
public CutCopyPasteTest()
Method Detail |
public static void main(java.lang.String[] args)
protected static void composeMenu()
protected static void composeTextFields()
public static void cut()
public static void copy()
public static void paste()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |