Simple StatusBar is a Java Swing desktop application demonstrating how to create a custom graphical user interface with a personalized status bar component.
The purpose of this project is to provide a simple example of:
- creating a desktop application using Java Swing;
- implementing a custom Swing component (
JStatusBar).
The application displays a window containing:
-
a Show button to display the time of a user action;
-
an Exit button to close the application;
-
a custom status bar displaying:
- an application status message;
- the current date;
- visually separated information areas.
- Java Swing graphical user interface.
- Automatically centered application window.
- Custom application icon support.
- Custom painted status bar component.
- User event handling.
- Date and time formatting using
DateTimeFormatter. - Compatible with modern Java Development Kits.
- Java Development Kit (JDK) 8 or later;
- OpenJDK 1.8 or later.
Check your Java installation:
java -versionFrom the directory containing the source file:
javac -Xlint:unchecked SimpleStatusBar.javaStart the application with:
java SimpleStatusBarjar -cvfm SimpleStatusBar.jar SimpleStatusBar_manifest.txt *.class SimpleStatusBar.pngjava -jar SimpleStatusBar.jarThe application attempts to load an icon named:
SimpleStatusBar.png
The resource is loaded using:
SimpleStatusBar.class.getResource("/SimpleStatusBar.png")The image must therefore be available in the application's classpath.
| Technology | Purpose |
|---|---|
| Java | Main programming language |
| Swing | Graphical user interface |
| AWT | Graphics and event handling |
| java.time | Date and time management |
This project is distributed under a license to be defined.
See the LICENSE file for more information.
Eric Normandin
This project was created as a learning and demonstration example of Java Swing development.
