• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My second frame will not open and my first will not close

 
Isaac Skelton
Greenhorn
Posts: 5
C++ Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 563
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the equals() method to compare Strings.

if username.equals( "this" )

etc. . .
 
Isaac Skelton
Greenhorn
Posts: 5
C++ Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic