File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes My second frame will not open and my first will not close Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "My second frame will not open and my first will not close" Watch "My second frame will not open and my first will not close" New topic
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: 557
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: 825
    
    5

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: My second frame will not open and my first will not close
 
Similar Threads
Boolean problem
java.lang.ClassCastException
Sending password/login info using sockets
Help with a simple login Gui
Adding a window to a container