/** * Insert the type's description here. * Creation date: (10/2/2003 8:02:27 PM) * @author: */ public class Login extends javax.swing.JFrame implements java.awt.event.ActionListener { private UserRecord root; Wages myWages = new Wages("Wages");
Button ok = new Button("OK"); Button cancel = new Button("Cancel"); Label user = new Label("Username:"); Label pass = new Label("Password:"); TextField userField = new TextField(); TextField passwordField = new TextField(); JPanel buttonPanel = new JPanel(); JPanel inputPanel = new JPanel(); JPanel resultPanel = new JPanel(); int tries = 0; String username; String password;
public Login() { ok.setActionCommand("1"); cancel.setActionCommand("2"); ok.addActionListener( this); cancel.addActionListener(this);
As you can see, if the password is correct (case 1), it will show up another class. So, i want to hide this logging applet. how do i do it? i tried many methods but i kept getting this error message: cannot make a static reference to a non-static.... can someone pls help me, i really need it ASAP thank you
"cannot make a static reference to a non-static.... "
If this is the error message then make the particular method or variable which is giving the error as static or try to call that from inside main method. The best is to make it static.
eg. if its a method: public static returntype methodname{ }
i still don't know how to do it. can someone pls specify where do i have to put the code and what code pls. i already tried yesterday for 2 hours and today another hour. thank you
i tried to put Login.setVisible(false); in (Case 1) and it gives cannot make a static reference to the instance method named setVisible for class java.awat.Component with arguments (boolean). i don't know if you do it like that or not