Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying errors in a GUI

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any ideas on how to display errors in a Swing GUI application if the user does not want to see dialogs?

Thanks.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the "status bar"?
 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's that? Is that an error of the application designed for displaying
errors? Is there another application I can look at that uses something
similar?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Status bars aren't really designed for error messages. If you can't use dialogs then I would either use in line error messages using a simple JLabel. You can set the font so that it is red, etc. If you don't have room per say for in line error messages, then create a message header on your form of some sort that can display error messages above all the components. Really, it's not that different than displaying error messages in web pages, if you are familiar with that at all.

Take a look at the JGoodies Validation Demo. It will give you some good ideas. You may even want to use that package.
 
Scott Delap
author
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll second JGoodies Validation. You can either display all validation errors in a summary component or change the components that have errors such as setting a text field background to red.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic