Create a simple layout for a frame
Now we will create a (very simple) layout to be displayed as a frame.
The new project you created in step 2 already contains a layout, rename it to 'Test Frame' either by selecting it in the project view and pressing <F2> or by selecting 'Rename...' from the layout's context menu.
|
| |
|
RADi project view
|
|
Layout context menu
|
The layout consists of the default design grid with 3 rows and 3 columns and an overall size of 240 x 180 pixels.
|
| |
|
The 3x3 default grid
|
|
JButton placed in cell [1, 1]
|
To place the JButton in the grid cell
|
|
drag the 'JButton' icon
|
|
from the components palette to cell [1, 1] of the design grid.
|
|
|
Components palette
|
Add an icon to the button
We will now add an icon to the previously created button:
|
|
Select the button by clicking its grid cell.
|
|
|
Select 'View | Show Properties - Events' or press <F8> to display the 'Properties - Events' panel.
|
|
|
|
|
In the table row starting with 'icon', click the second ('<none>') cell, then click the [...] button.
|
|
|
In the file chooser browse to the RADi/Tutorial/icons directory and open testicon.gif .
|
|
|
The 'Portability Issue' dialog will show up:
|
|
|
|
Click [Copy].
|
|
|
A resources directory was created inside the MyProject directory. It is important, that all resources for a project go there.
|
|
| |
|
The current 'MyProject' content
|
|
JButton with icon
|
To view the layout as it will appear in a frame, click the 'Show Test Frame' button
|
|
in the RADi toolbar or press <F11>.
|
|
|
See also: Resources
|
|
|
|