|
1. Click in the "empty" box

2. You'll see the alternatives in the dialogue:

3. If you click on any of the layout
buttons, a JPanel is created with new empty
fields. The JPanel is created with the LayoutManager you've chosen.
GridLayout (Don't forget to write
the number of rows and columns you want befor you click the
GridLayout-button)
BorderLayout
FlowLayout
Each Layout you create in the form will be marked with a separate colored
border, blue for GridLayout, green for BorderLayout, purple for FlowLayout.

You also have the possibility to remove the whole panel where the field exists
with [Remove Layoutpart].
NB! If you remove a panel, all other panels or elements it contains will also
be removed.
If you in the example above click on a field within the blue frame and choose
[Remove Layoutpart], this GridLayout is removed (4 fields in the example above), but if you e.g. click on a
field above the blue frame, the BorderLayout-panel is removed, including the GridLayout- and
FlowLayout-panels.
4. When you in the Layout palette click
on another item, such an item will be created in the empty field, e.g. JButton:

5. Then it's just to continue until you
have the layout you drew on paper when planning it :-)

6. If you click on a field where you already
have put an element, you'll get a
"property"-dialog, where you can change the values for this item:
Which properties you can change, varies
between the different items, e.g:
Name = This is the name of the variable
referencing the element, as it will turn up in the source code.
Text = If your item can have a visible text, this will be the initial
value
ActionCommand = If your item can generate events, this will be its "actionCommand"
Selected = If your item can have a boolean value (e.g. JCheckBox), this
is its initial value
ImageFile = The name of the image file to display (e.g. Nisse.gif)
ButtonGroup = The name of the variable for the ButtonGroup a JRadioButton
is part of.
You also have the possibility to remove
the item from the form with
[Delete].
7. When you save the changes with [Save]
some changes will show directly in the editor; Name (variable name) and
either Text (the text used as initial value) or ImageFile
(name of the image file to be used):

8. When you click [Generate and Run]
you'll get a dialog where you choose what directory to put the files
into (You must first fill in the name you want for your JFrame class):

9. When you've marked the directory and
click [Save] the source code file will be generated. It will also try to
compile and run it:

10. Hopefully you'll now see your
efforts displayed on the screen:

Not much to see, but now you can use
your favorite editor to make the last adjustments by yourself...
|