Home » Desktop Java » swing » JFrame

JFrame

Java JFrame Example

In this example we will show how to use the class JFrame and how to create a simple gui by using the javax.swing package. JFrame class is one of the containers provided by the java.awt package. Containers in java.awt are components where other components can be located. Another example of a container provided by java.awt is JPanel. So, JFrame works ...

Read More »

Center JFrame/JWindow/JDialog on screen

In this example we shall show you how to center JFrame, JWindow, JDialog components in a Java Desktop Application. You can use this when you want to center you windows in your application automatically. For example, if your application has to handle many windows, you might want to add a button that centers the components you want. Basically, all you ...

Read More »

Create JFrame window with mouse event handling

This is an example that demonstrates how to create a JFrame windows that supports mouse event handling. This is very useful in most GUI applications because most of the time it is very efficient for the user to provide input using his mouse. Additionally, you can make your application behave accordingly to mouse movement and generally to mouse events. Basically ...

Read More »

Create JFrame window with window close event

This is an example on how to create a JFrame window with window close event. Pairing a window with a closing event is a very common practice in most GUI applications. When the user closes a window, it usually means that you have to release several resources or event exit the application. The basic steps to create a JFrame with ...

Read More »

Create JFrame Window

In this tutorial we are going to see how to create a JFrame window. The JFrame window is the single most important component in a Java Desktop Application. It’s the basic platform in wich you organize all of the application’s components and features. Basically you build your application around it. It is very simple to create a JFrame window as ...

Read More »