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.
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.
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 ]