Components in grid cells

  Variable names
  Anonymous and non-anonymous components
  Copy and paste

You place components (or containers) in the grid by dragging them from the component palette to the desired grid cell.
The component palette
Tip: If you want to insert several components of the same kind, you can do this with Ctrl-Shift-Click.

To move components with the mouse from one grid cell to another, the initial click has to be inside the component's bounds (in contrast to the component's grid cell).
To copy the component instead of moving it, additionally press Alt.
Move component Copy component

You can apply containers to components (or other containers) by placing the container in the component's grid cell. To add a component to a container, drag the component to the container's grid cell.
Apply JScrollPane to ImageIcon  Ex 13 Add JList to JTabbedPane  Ex 12

You select a component or container by clicking its grid cell, you select multiple components with Ctrl-Click and you create contiguous selections with Shift-Click.
Single selection Multiple selection Contiguous selection
Note: One can not create multiple selections containing components belonging to different parent containers.

To delete selected components, press Backspace or Del.


Variable names     Top of page

Each component has a variable name (unique within the component's name space). To change it, either Alt-Doubleclick the component or select 'Rename...' from the component's context menu or press <F2> while the component is selected.
Note: There is one reserved variable name: "defaultButton". The JButton having this name will be set as default button if the exported layout class extends JFrame, JDialog or JApplet.


Anonymous and non-anonymous components     Top of page

Each component has an anonymous state. When exporting a layout, you can choose that only non-anonymous components shall appear as member fields of the exported class (see Exporting layout classes). In the project view, you can choose to hide anonymous components so you can concentrate on the more important components when editing the layout. By default a component is anonymous, you can change this from the component's context menu.
Note: If you change a component's variable name, the component's anonymous property will automatically change to false.

The tooltip of non-anonymous components will show the underlined variable name .
By pressing and holding <N>, the tooltips of all non-anonymous components of the layout will show up.


Copy and paste     Top of page

You can copy and paste components between different grids, different layouts and also between different projects. If you have copied a selection including several components and paste them into a design grid, RADi tries to preserve the component's relative position if possible, else the components are pasted one after another into the empty cells, beginning with the (first) selected cell.
If the number of empty cells is less than the number of components to paste, the action will be cancelled.
Note: If you copy components to a different project, all referenced resources will be copied, too.
See also:
    RADi Shortcuts
    Resources