Java does not have a built-in StatusBar class in Swing. You need to create your own status bar. The following class creates a simple status bar using JLabel. You can improve it based on your needs:

 public class StatusBar extends JLabel {
    /** Creates a new instance of StatusBar */
    public StatusBar() {
        super.setPreferredSize(new Dimension(100, 16));
    public void setMessage(String message) {
        setText(" "+message);        

You can use this status bar in your programs as follows:

 statusBar = new StatusBar();
getContentPane().add(statusBar, java.awt.BorderLayout.SOUTH);


Note that we added the status bar at the bottom of the frame using BorderLayout.

You can also change the message on the status bar using setMessage method.