What Will I Learn?
- We will learn about Java
- We will learn about JFrame Form in netbeans
- We will learn about Palletes in Netbeans
- We will learn about jOptionpane
- We will learn about how to make a login program using Netbeans
Requirements
- Microsoft Windows (32 bit/64bit)
- JDK (Latest update)
- Netbeans IDE
Difficulty
- Basic
Tutorial Contents
1. Basic Theory
- Java
Image source
Java is a High-Level programming language and a java program composed of parts called classes.
- Netbeans
Image source
Netbeans is opensource app or a free product tool for programmer to create a code, compile, troubleshoot and more. NetBeans support on any OS (Microsoft Windows, macOS, Linux and Solaris). The NetBeans platform allows program to be built from modular software components called Module. Module is a Java Archive that creates Java classes to interact with the NetBeans Open API and manifest files that identify it as a module.
- Components used in this tutorial
a. JFrame Form

JFrame Form is form in design view to put any components or palettes as needed.
b. Palette

All components used for designing the form are placed in this section. That have been provided quite complete.
c. jOptionpane

To show dialog containing an information we can use jOptionpane in Netbeans.
2. Procedure
- Step #1 : Open Netbeans
Double click on Netbeans application in desktop, then open Netbeans :
- Step #2 : Create new project
Click on File > New Project like in below :
After show New Project Display, Choose Project with Categories on Java and choose Java Application in Projects , and Next :

- Step #3 : Create name and location
Create name of project in Project Name , put the project at location file to save in directory on your computer for Project Location, and then click Finish :
- Step #4 : Create new JFrame Form
After created project and then we will create JFrame Form. First, right-click on your project (LoginForm) like in below :
Then, create name of class in Class Name. Make sure the class name inside the LoginForm project and location on Source Packages, and click Finish :

- Step #5 : Create design in JFrame Form
Design a form with palette of Swing Controls in Palette Group. Drag and drop some palettes such as jLabel, jTextfield, jButton, jPasswordField to design in JFrame Form like image (A) in below. Then, edit the palette from image (A) into image (B) by edit and change at Font and text in Properties.
- Step #6 : Add source code
After design, we will add source code in Login button by right-click at Login button choose Events > Mouse > mouseClicked :
After moved to Source code display, add code in below jButton1MouseClicked, the code are :
jTextField1.setText (" ");
jPasswordField1.setText ("");
JOptionPane.showMessageDialog(null,"Berhasil masuk", "Sukses",
jOptionPane.INFORMATION_MESSAGE);
Show as image :

When you get a display below, click Ok

- Step #7 : Run project
Finally, we do the last step on this project. That is run project or run program, to run this program we have to click start in toolbars or press F6 at keyboard. Then show up as below :

Input username and password and then click Login button, and then appear as below :

Finish.
Curriculum
This is my first tutorial about Java using Netbeans
Posted on Utopian.io - Rewarding Open Source Contributors
nice post @devarizaldi
thank you
sangat indah bung @devarizaldi
terimakasih bung @saputra.ridho
Your contribution cannot be approved because it does not follow the Utopian Rules.
You can contact us on Discord.
[utopian-moderator]
thank you mod @yokunjon , i could make some useful tutorial in feature.