Creating a simple window application using Java Swing

A simple window application using Java Swing Swing is a toolkit API that makes it easy to build user interfaces using Java. The Swing API has about 18 public packages containing various Swing components which can enable us to create all sorts of GUI features. The interface components work the same on most platforms. In this article, we will be setting up a basic GUI application window. This will enable one to build more complex applications in the future. Before proceeding ahead, let us try to wrap our heads around the concept of packages in Java. Packages Relationship between a package and its underlying classes The above-given diagram illustrates what a package is and how its child classes can be accessed from outside. A package can be seen as a directory (or a folder) that contains some source files defining useful classes. The diagram describes the way to import the classes from a package. Now to import the Swing API classes you must add the following line to your code: impor...