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

Displaying error on an Applet

 
Nadda Habba
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have created an applet for a login screen. I have validation methods in my applet. I need to display errors within the applet for failed validations. how do i do it ? in jsp i can use out.println() function but am unaware how to achieve the same in an applet.

any suggestions ?

thanks in advance

nadda
 
Pete Tibbster
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could...
1. You could write the error to the console log. Use System.out.println(error) to write an entry to the java plugin console.
2. You could create a JLabel, add it to your screen and set the text to the error message to display the error back to the user.
 
Joe Ess
Bartender
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use AppletContext.showStatus(String status) to display a message in the status window at the bottom of the browser, but your users are likely to miss it.
You could pop up a dialog window, but you can't make dialogs modal in an applet (a modal dialog remains on top of the app and blocks input so the user has to respond to it)
I prefer to display a dialog within the applet, but block input to it. You can do this by displaying an "internal dialog" with one of the JOptionPane.showInternal*Dialog() methods and by adding a MouseListener to a JApplet's glassPane to block all other input.
[ February 28, 2005: Message edited by: Joe Ess ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic