event doesn't switch context after switching jpane & class
Hi,
I have (almost) managed the concept (tight) coupling. I switch panels on the display by invoking a method in the parent. However something strange occurs:
I have a first panel with an actionListener, getting a user name.
I have a second panel showing a simple list of choices 1 .. 2.. 3 .. also with an actionListener.
When I switch the panels from the usernamepanel to the choicespanel I see the choicespanel,
but making a choice and pressing <enter> tells me to put in a userID (I cleaned that field on the first panel).
So the actionListener defined with the choicespanel is not 'in control'.
And the actionListener with the username still is.
Explicitly removing the actionListener from the first panel does not help (?!)
Would you know what it is that I do not understand about this situation?
publicvoid checkUsername (){
JPanel sign_in_pnl =new Sign_in(this);
this.add(sign_in_pnl,"0,0,0,0");
Sign_in.User.requestFocus();
}
publicvoid switchComponent (){
this.remove(1);
JPanel choose00 =new Choose00();
this.add(choose,"0,0,0,0");
Choose00.Selection.requestFocus();
}

