0% found this document useful (0 votes)
174 views1 page

Intellij Gui Designer Example: 4.1 Creating A New Project

This chapter demonstrates how to create a graphical user interface for a simple calculator application using IntelliJ IDEA's GUI Designer. The GUI Designer allows dragging and dropping Swing components onto a Form container. It generates a .form file to store the GUI layout and a bound Java class to control the components. The example will create a new project called CalculatorGUI and add a JTextField to the form to display calculation results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views1 page

Intellij Gui Designer Example: 4.1 Creating A New Project

This chapter demonstrates how to create a graphical user interface for a simple calculator application using IntelliJ IDEA's GUI Designer. The GUI Designer allows dragging and dropping Swing components onto a Form container. It generates a .form file to store the GUI layout and a bound Java class to control the components. The example will create a new project called CalculatorGUI and add a JTextField to the form to display calculation results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Chapter 4

IntelliJ GUI Designer Example


This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface
that is based on the
Swing library components. It must be noted that IntelliJ does not support modeling of non-swing
components.
When working with the GUI Designer you operate in design view where you are able to drag and drop
swing components within
the context of a form. All GUI information related to the form are stored in a file with .form extension.
When creating a GUI
component in IntelliJ you begin by creating a form, this form serves as a container that groups all other
components that are
required for your application. When a form is created, IntelliJ provides you with an option of also creating
a Bound Class. A
Bound Class is a Java class that is bound to a form and contains auto-generated code that reflects the
components that are added
on the form. The bound class can be updated at any point to add specific behavior on the components that
have been added in the
form.
In this example we shall create a simple calculator application to demonstrate how you work with the
GUI Designer.

4.1 Creating a new Project

Launch IntelliJ and create a new project called: CalculatorGUI.

4.2 Graphical view

The graphical view allows you to drag and drop swing components to be added on the Form of the
application. When any file
that has a .form extension has been selected into the view, the following windows are displayed:
• Component tree - displays the hierarchical view of the components that have been added on the form.
• Property editor - displays the properties of the components added on the form which can be edited.
• Design area - the graphical view of the form. Components are dragged into this area to be added on the
form.
• Palette - contains all available swing components that can be selected to be added on the form.

4.3 Creating the GUI

4.3.1 Add Results display

Drag the JTextField from the palette and drop it in the design area. Update the field name in the property
editor to read:
results

You might also like