Problem with displaying an confirmation or error message

i'm trying to get a frame with a message to pop up when a certain condition is met. ex. if a person trys to make an account with a feild blank. it sends a frame with "Fields cannot be blank". When i go to load the frame from the same class it works. but, when i run it from a different class and try to access the frame through a public method it will not display. I've tried using just a text area on the account creation screen with no success. I was wondering if anyone had any suggestion on how to fix this so that the frame will appear.

//JournalPage Class Methods:

//this sets the message for the frame and makes it visible.

public void eDialog(String msg){

errormessage.setText(msg);//sets the error message in the frame

errorbox.setVisible(true);// makes the error frame visible

errorbox.toFront();// brings the error freame to the front

}

eDialog("Invalid Username/Password");

// sets message for the frame called from the same Class

-

//UserInfo Class

JournalPage jp = new JournalPage();

if(Pasword.equals("") || UserName.equals(""){//Checks if feilds are

//blank

jp.eDialog("Fields Cannot Be Blank");//should display a frame but it

//does not.

}

[1268 byte] By [ddecreea] at [2007-11-27 11:27:24]
# 1

Take a look here http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

plenty of examples that do what your looking for.

In future please use the Swing forum for Swing questions.

_helloWorld_a at 2007-7-29 16:16:00 > top of Java-index,Java Essentials,Java Programming...