Easily Creating a GUI in Java Using JFrame in NetBeans 8.0
Quick introduction to using JFrame tools in NetBeans for creating Java GUI applications.
This guide will show you a quick introduction on using the JFrame tools in NetBeans to easily create a GUI for your java programs. NetBeans provides a user interface that allows you to very easily generate your GUI without having to hand code it yourself.
Begin by creating a new project in NetBeans. Inside the new project create a new JFrame Form. If you have ever worked with visual basic this may look familiar. You can now see that you have a canvas and an area on the right with all sorts of buttons, tables, boxes, etc. Simply drag over an element and place it on the canvas.
You may double click the element and it will take you into the source and you should see something similar to this code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//code goes in here, for example
System.out.println("hello");
}
For every element you add, you can double click and it will take you to this ActionPerformed method. This makes it incredibly easy to add lots of elements to your java project and easily add logic to them.