Discussion Locked

how to set status bar in java

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i would like to know the status of the application while it is opening or running
i am not discussing here about java progressBar
i am interested more in java status bar

so..
plz help me to put a status bar

1 reply

by cdumitru

The Swing library doesn't have a specific component for statusbar. The hack is you create a ordinary component- say JPanel - and set its border to LOWERED - BevelBorder. Then add this component to the SOUTH of your BorderLayouted JFrame.

import javax.swing.*;
import javax.swing.border.*;

====================

JPanel jp_status = new JPanel();
jp_status.setLayout(new BorderLayout());
jp_status.add(new JLabel("Subhash"), BorderLayout.CENTER);

jp_status.setBorder(new BevelBorder(BevelBorder.LOWERED));

// ``ct'' is the Container of JFrame
ct.add(jp_status,BorderLayout.SOUTH);

You can also check http://www.jguru.com/faq/view.jsp?EID=476472

This discussion is closed to new replies.