2

I've tried everything and i cant get with the answer, there is not much topics talking about it.

Here the escenario:

Once the user run the app, 2 FrameViews display. The main frame and the login. Whenever if the user exist, the login frameview must be close and let me edit the main_frame.

But i cannot close the login frameview. Dispose doesnt exist, close neither. What do i have to do?

the login form is name

demo

and the main_frame

main_frame

Suggestions?

Update

HERE the code where the login login must be close

 private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { 

        String pass = this.jTextField1.getText();
        String user = this.jTextField2.getText();

        boolean login = db.Qboolean(new String[]{
            "SELECT Id_User FROM login WHERE UserName = ?  AND Pass = ?",
            pass +","+user,

        });

        if(login)
       //what do i have to use here to close it!!!


        else
            Logs.Mensaje("No se pudo :(");

    }        
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 2
    How about showing us your code? FrameView is not a standard swing (and even Java) class, so I'm not even sure, from your question, if you're really using swing. – JB Nizet Apr 27 '13 at 21:23
  • Done, if thats not what you are looking for, you can tell me what part of code you want –  Apr 27 '13 at 21:26
  • The part I'd like to see is the part where you're trying to close the login frame or dialog, siwnce that's where the problem is. – JB Nizet Apr 27 '13 at 21:29
  • Check now. Hope that code is what you need. –  Apr 27 '13 at 21:34
  • 2
    Take a look at [JFrame#dispose](http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#dispose()) and [JFrame#setVisible](http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setVisible(boolean)) – MadProgrammer Apr 27 '13 at 21:34
  • The log-in should be a modal dialog or an option pane. This is discussed about every 8 hours on SO. See [How to Use Modality in Dialogs](http://docs.oracle.com/javase/tutorial/uiswing/misc/modality.html) & [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) – Andrew Thompson Apr 28 '13 at 04:57

1 Answers1

0

If you're using Netbeans , there is another way (and easy) to check username and password ! you can define a new Jfram in run(){ }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {
//here you can make log in form within while and check if the user is exist 
//continue 

 new Graphic().setVisible(true);


}
Soroush
  • 116
  • 7