NetBeans IDE 6.0 Guide How to build GUI programs

Source: Internet
Author: User
Tags netbeans

This introductory tutorial will teach you how to create a simple Man-machine interface and add simple background functionality to it. In particular, we'll show you how to write control buttons and field codes according to the Swing specification.

We will use the layout management, design a simple GUI interface, and add some button and text field components. The text field is used to receive input and display output, and the button is used to start the corresponding function on the front end. The application we will create will be a simple but useful calculator.

For more GUI design features, videos, and documentation, see Desgning a Swing GUI in NetBeans IDE.

The software required for this tutorial

Please make sure that your computer has the following software installed:

NetBeans IDE 6.0

Java Standard Development Kit (JDK) version 5.0 or 6.0

Step 1: Create the project

The first step is to create an application and name it numberaddition.

Select "File"-> "New Project". Or, on the toolbar, click the New Project icon.

Select Java in the Categories pane of the pop-up window, and select Java application in the Projects pane. Click "Next";

Type numberaddition in the project name and type the local file directory in project location to save the project;

The Confirm CheckBox "Set as Main project" has been checked. And make sure the checkbox "Create main class" is not checked.

Click "Finish"

Step 2: Build the interface

Continue to create our interface. We need a Java container to place other GUI components that will be invoked. In this step we use the JFrame component as the desired container. We place the container in a new package that is located in the source package.

Creating a JFrame Container

Right-click Numberaddition in the Projects window and select New-> JFrame form.

In the class name item, type Numberadditionui.

Type My.numberaddition in the package item.

Click Finish.

The IDE creates the Numberadditionui form in the Numberaddition application based on the class Numberadditionui and opens the Numberadditionui form in the GUI Builder. Package My. Numberaddition is set to the default package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.