• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to write info to Frame's status

 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to write some message on JFrame's status, but i don't know ho to do. can you show me?
thanks !
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Hiep
setTitle("something");
which can display the text in the JFrame title
but I do not know where you want to show the message.
The other one method accepts the string is the following.
setName("something");
I hope that it can help you or you can point out more details
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you maybe thinking of the showStatus(String) method of an Applet?
 
Hiep Nguyen
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes! i want it show an message in status like showStatus() in applet. maybe JFrame don't support this, but i don't know which swing class suport this that has same properies as JFrame? becuase i write an application
thank you!
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
create your own statusbar at the bottom of the frame. for example:
JLabel status = new JLabel("waiting on user input", SwingConstants.LEFT);
jFrame.add(label, BorderLayout.SOUTH);
whenever the status changes, you call
status.setText(/* the new status */);
if you are working with multiple threads you should call setText inside of SwingUtilities.invokeAndWait.
Chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!