Gola


A Graphical Layout Editor for Java Swing/AWT



Menu/Toolbar Items

Property Panel

The property panel allows you to edit some of the parameters associated with selected component when it is selected.
  • The name is the name of the variable in the generated class that represents the component. It has to be a unique Java identifier.
  • The text is the text displayed in the components such as buttons and labels. The text editor can also be used to edit the title of tabs in a tabbed panel.
  • The background color of the component can be changed or set to the default value. When default background color is selected for a component, the generated code does not make an explicit call to the setBackground method of the component when it is instantiated.
  • The foreground color of the component can be changed or set to the default value. When default foreground color is selected for a component, the generated code does not make an explicit call to the setForeground method of the component when it is instantiated.
  • The border of a component can be selected from a small set of possibilities. When a default border is selected for a component, the generated code does not make an explicit call to setBorder for the component when it is instantiated.

    In contrast to many other layout managers, Pagelayout does not normally use panels whose only purpose is to aid in the managing the layout of components contained in them. However, if a border other than default (or a border title, see below) is specified for a row, column or a grid, these cells are replaced by panels with the specified borders in the generated class.

  • The title of a component to be displayed on its border can also be specified in the property panel.

  • The model of a list or a combobox, which display an array of strings, may be edited by clicking on the model display box of the property panel.

Inserting Components not in the Component Palette

The number of different types of components that can be inserted into a GUI is quite limited. If you want to use a component that is not in the list of components in the component palette, the recommended approach is illustrated here for inserting a JColorChooser object:
  • In the GUI that you build using Gola, insert a panel in the place where you want to place the color chooser object. We assume that you name this panel as colorPanel by editing the name field in the Property Panel of the Gola GUI.
  • Save the GUI to generate a Java file. The name of the generated file is the same as the file name that you choose in the file save dialog which comes up when you save the file.
  • Either in the generated class, or in a class that you constuct to extend the generated class, edit the decorateComponent method to insert the following line:
    • EasyCell.coverPanel(colorPanel, new JColorChooser());
    Here the class EasyCell is a part of the PageLayout distribution.
Clearly the same method can be used for any object which is a subclass of JComponent.