D
DyslexicAnaboko
I am having a problem that has really got me stuck and I think it is
because I am going about it incorrectly.
Here is my problem in the most plain terms possible:
I wrote a program that has a Class "A" and for class A there is a GUI
class called "A_GUI" in its own package called "GUI".
The following should occurs between the two classes:
I launch Class A, which will in turn invoke class A_GUI.
It is done in this order because class A need to load data from certain
files and what not before A_GUI can be useful.
The A_GUI class has two fields to fill in, for arguments sake we will
call them the:
userName and passWord fields.
When A_GUI is invoked the user is prompted to input his userName and
passWord.
After the user puts in their information they will press login.
Login in turn will send the users input back to class A for validation.
Class A will validate the user and log them on to the system.
The problem I am having occurs at the creation of A_GUI. The specifics
are that the screen launches successfuly, however class A continues to
run after invoking class A_GUI. This is a problem because class A is
trying to validate two strings that have null values. This ends up
making the program stop and throws a null pointer exception for very
obvious reasons.
What I want to do (correct me if I am going about this the wrong way)
is somehow tell class A to WAIT until it gets a response from A_GUI,
and then, and only then will it proceed to function. I think this has
something to do with eventListeners, but I do not know how to make one
class listen for another class.
I would greatly appreciate it if someone could help me with this
because I am at total loss.
because I am going about it incorrectly.
Here is my problem in the most plain terms possible:
I wrote a program that has a Class "A" and for class A there is a GUI
class called "A_GUI" in its own package called "GUI".
The following should occurs between the two classes:
I launch Class A, which will in turn invoke class A_GUI.
It is done in this order because class A need to load data from certain
files and what not before A_GUI can be useful.
The A_GUI class has two fields to fill in, for arguments sake we will
call them the:
userName and passWord fields.
When A_GUI is invoked the user is prompted to input his userName and
passWord.
After the user puts in their information they will press login.
Login in turn will send the users input back to class A for validation.
Class A will validate the user and log them on to the system.
The problem I am having occurs at the creation of A_GUI. The specifics
are that the screen launches successfuly, however class A continues to
run after invoking class A_GUI. This is a problem because class A is
trying to validate two strings that have null values. This ends up
making the program stop and throws a null pointer exception for very
obvious reasons.
What I want to do (correct me if I am going about this the wrong way)
is somehow tell class A to WAIT until it gets a response from A_GUI,
and then, and only then will it proceed to function. I think this has
something to do with eventListeners, but I do not know how to make one
class listen for another class.
I would greatly appreciate it if someone could help me with this
because I am at total loss.