Cutting, copying, and pasting in the visual editor for Java

The visual editor supports cutting, copying, and pasting in the Design view and Java beans view. You can copy single widgets or containers with their children.

When you are designing a visual class, you will often want to quickly cut or copy an element then paste several instances of the same element in another spot in your application. When an item is copied, not all of the item's properties are included, but typically the key visual properties are included in the paste. For example, when you copy and paste a button, the text for the button is included. When you cut or copy a Swing container or SWT composite, the child controls are copied too.
The standard keyboard shortcuts are supported:
  • Ctrl+X (cut)
  • Ctrl+C (copy)
  • Ctrl+V (paste)

To cut, copy, and paste components using the visual editor for Java:

  1. In the Design View or Java Beans view, right-click the element that you want to cut or copy, and select Cut or Copy.
  2. Do one of the following to paste the item:
    • In the Design view, click the canvas to load your cursor with the copied component. Now you can drop the component in an appropriate location the same way you would drop an item from the palette. For example, you can click and drag to specify the initial size and bounds of the dropped component.
    • In the Java Beans view, right-click the container where you want to paste the item, and select Paste.

(C) Copyright IBM Corporation 1999, 2004. All Rights Reserved.