Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Status display

 
Huang Crystal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am implementing a GUI interface using swing. One of the requirements is to provide the status in the status bar.
For example, when the program is pinging all the IP addresses within the domain, the status bar should display something like "Pinging IP addresses...". Another example would be when opening a file, the status bar should display "Opening file..." etc.
Any example codes/help will be greatly appreciated.
Thanx for the help...0=)
------------------
0=),
Crystal
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you are doing this in an applet, you aren't going to get text to show up in the 'status bar' of the application frame. However, you can basically do the same thing by just adding a Textfield at the bottom of the frame and sending messages to it instead of the status bar...
 
Huang Crystal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I do not quite understand. Do you mind to explain more specifically?
Thanx..
------------------
0=),
Crystal
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK... here's how you would normally do it in an Applet ( or JApplet, since you said you were using Swing... ). You would just call showStatus() with the string you want to display. This only works because the showStatus() method is defined in Applet to display text in the status bar.



But, if you are not using an Applet derivitive, you do not have the showStatus() method... so you have to find a workaround... I proposed just adding a JTextField at the bottom of the screen to take the place of the status bar...



HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic