Simple GUI Extension for BlueJ

czech english


Installation and requirements

Requires JDK 1.7+

Copy GUI_Extension.jar into a folders according of you OS:

For all:

  • <BLUEJ_HOME>/lib/extensions (Unix)
  • <BLUEJ_HOME>\lib\extensions (Windows),
  • <BLUEJ_HOME>/ (Mac OS)

For user:

  • <BLUEJ_HOME>/.bluej/extensions (Unix)
  • <BLUEJ_HOME>\bluej\extensions (Windows)
  • <BLUEJ_HOME>/Library/Preferences/org.bluej/extensions (Mac OS)

Extension's GUI


Description of the interface

  1. Available components
  2. Table for editing properties and events
  3. Panel which allows switching between 'design', 'code' and 'menu generator'
  4. Combo Box for selection of embedded components
  5. Main canvas

Available components

  • JButton
  • JComboBox
  • JEditorPane
  • JCheckBox
  • JLabel
  • JList
  • JPanel
  • JPasswordField
  • JRadioButton
  • JTextArea
  • JTextFieldArea

How to start this extension

After BlueJ starts and an project open this extension is avalible in the Tools menu under the name "Simple GUI Extension".


Adding and deleting components

Components are being added on the main canvas via Drag and drop.

Aplication allows to add components onto another panel. You can insert panel or another component inside another panel.

You can delete any component by:
  • pressing DELETE key (when the component has focus)
  • clicking the right mouse button and selecting DELETE from pop-up menu
pop-up menu

Properties setting

After adding component on the main canvas, the table with properties will be updated.

Tabulka vlastností
The table includes the ability to edit basic properties such as:
  • Component name – used during code generation
  • Component location
  • Component size
  • Foreground color
  • Bacground color
  • Information about the parent component
  • Option to enable or disable the seleceted component
  • Set font family, size and font style
  • Text on the component (if the seleceted component allows it)
  • Visibility of the seleceted component

Properties such as 'component size', 'foreground color' and 'background color' are entered using the numeric values ​​separated by a semicolon. Font is specified by it's name, font style and size, separated by a semicolon.

Enabling and disabling the selected component as well as changing it's visibility is avalible by clicking the appropriate cell in the table. If you hide a component and loose it's focus, so you have to select it from the Combo Box with the list of components. When the component gains focus again, you will be able to change the visibility again in there.

Set properties using the mouse and keyboard

Use the mouse to change specific attributes, such as component's 'size' and 'position' or via pop-up menu it's foreground and background color.
Resizing is accessible after moving to the bottom right corner of components.

Use the keyboard for deleting by DELETE key or moving component by using arrow keys.

Pohyb komponenty Změna velikosti

Events setting

After a component gains focus switch on the panel titled 'Events' where you can register events.

Tabulka eventů

After selecting an event press the button [...] to display the dialog window. Type in the method name which will be performed during the event. If the name of the method is already in use, the application will notify you.

How to make a menu


Application allows menu generation via a tree structure.

Menu name should be unique (uppercase and lowercase letters do not make difference).

You can rename any menu item by one clicking on it and waiting a little or by using F2 key or selecting 'Rename' from the pup-op menu.

Last options sets acceleration keys to menu items (like save = CTRL+S). Changes will be saved automaticaly.

Vygenerované menu

To insert a menu separator use a hyphen.

Code generation

The code generation occurs in two cases:

  1. When the code is beeing saved
  2. When we the tab is changed to 'Code' tab

Code generation is one way only ie., for example if you make some changes in the code, thay will not be reflected in the design. Any changes in the code will not be saved.

First create a design,then save it, then modify the code to your liking

The name of the main canvas is used as the java class name.

Some properties might not be used, but due to the fact that the application serves to beginners, it is better to show a complete code.

Code saving

You can save the code by selecting "File -> Save" from the menu or press CTRL + S. The name of the name of main canvas will be used as name of java class name. If this class already exists, the user will be notified.

After the code is save BlueJ reloads the package and you are ready to compile and run your project.

It is not possible to import a previously saved project in the current version of this extension.
Katedra informatiky
webmaster: Tomáš Svatek ©2013
Datum poslední aktualizace: 17.10.2016
Source code