The Artima Developer Community
Sponsored Link

Java Answers Forum
statusbar using java swings

2 replies on 1 page. Most recent reply: May 3, 2003 4:51 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Rastapuram venkat

Posts: 1
Nickname: rastapuram
Registered: May, 2003

statusbar using java swings Posted: May 1, 2003 10:45 AM
Reply to this message Reply
Advertisement
Hello sir,

Please tell me how to add statusbar to JFrame


regards
venkatesh


James Patterson

Posts: 16
Nickname: jmep
Registered: Mar, 2003

Re: statusbar using java swings Posted: May 1, 2003 11:06 AM
Reply to this message Reply
There are lots of ways to do this... Try adding a JLabel to a JPanel in the SOUTH of a window using BorderLayout. Add a method to call the label's setText() whenever you want to change the status message. It's not very sophisticated but it will get you started.

James

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: statusbar using java swings Posted: May 3, 2003 4:51 PM
Reply to this message Reply
Every Frame and JFrame also has a Title in the Title bar
you set the text of the title with the method:

public void setTitle(String?title)

The title bar appears at the top.

another option would be a JTextField that is not editable.
You could add this to a JFrame like a JLabel.

For either of these, its a good idea to set the preferred size so that it stays the same height and width.

Otherwise you have to call validate() after you change the text.

Flat View: This topic has 2 replies on 1 page
Topic: don't understand the problem - using methods Previous Topic   Next Topic Topic: Read from file

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use