A visual GUI editor tool – palette
The Java programming language, a GUI extension library such as Swing
, and a development environment – a powerful one such as NetBeans – can be a really strong combo. Now we're going to take a look at how to create GUIs using a GUI editor like the one found in NetBeans.
Note
To follow along, I highly recommend that you utilize the NetBeans IDE for this section.
So, to get started, let's create a Java application like we normally would and give it a name and we're good to go. We're going to start off by simply deleting the default Java file that NetBeans provides and instead ask NetBeans to create a new file. We're going to ask it to create a JFrame Form
for us:

We'll give this JFrame form a name and keep it in the same package. When NetBeans creates this file, even though it's a .java
file, the window that pops up will look really different to us. In fact, our file is still just Java code. Click on the Source
tab to see the code as shown in the following screenshot...