0
if (source  == loginbtn )
            {
               JFrame frame = new JFrame ("AdministratorLogin");
               frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
               frame.getContentPane().add (new AdministratorLogin());
               frame.pack();
               frame.setLocationRelativeTo(null);
               frame.toFront();
               frame.setVisible (true);
               frame.setResizable(false);

             //the commented dispose code will give me an error of cannot find symbol
            //  dispose();

            }

Edited by Dani: Formatting fixed

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by JamesCherrill
0

Because there is no handle for the member method dispose(), hence there is no idea about which frame is to be disposed. Try:
frame.dispose();

0

You call dispose() without an object, so that's equivalent to this.dispose();
You didn't show enough code for us to see what kind of Object "this" is, but maybe it's something that doesn't have a dispose() method?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.