| Author |
My second frame will not open and my first will not close
|
Isaac Skelton
Greenhorn
Joined: Sep 06, 2012
Posts: 5
|
|
Im having problems with the secong frame, I have put in capital letters a comment next to my problem. I can not get the old frame to disapear and open the new one (I dont know if login.dispose() is even java, it was just a guess).
Thanks in advanced I. Skelton
|
 |
Greg Brannon
Bartender
Joined: Oct 24, 2010
Posts: 530
|
|
Use the equals() method to compare Strings.
if username.equals( "this" )
etc. . .
|
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
|
 |
Isaac Skelton
Greenhorn
Joined: Sep 06, 2012
Posts: 5
|
|
Greg Brannon wrote:Use the equals() method to compare Strings.
if username.equals( "this" )
etc. . .
Thanks you so much, it worked perfect and it was a quick reply to my question.
|
 |
Kemal Sokolovic
Bartender
Joined: Jun 19, 2010
Posts: 792
|
|
What is that empty statement in else doing there?
When comparing strings, make sure you use equals() as suggested, and try to do it this way:
This way you avoid getting a NullPointerException.
Also, try not to name your variables like_this, but likeThis, since it's common in Java.
|
The quieter you are, the more you are able to hear.
|
 |
 |
|
|
subject: My second frame will not open and my first will not close
|
|
|