我无法理解为什么访问历史记录窗口不能为我打开,下面是正在执行的代码,当我按下btnAccessHistory按钮时没有任何反应但它在行 accessHistory中给我一个错误gui = new accessHistory ,我可以说明原因。
package securitySystem;
import java.awt.*;
import javax.swing.*;
import java.sql.*;
import java.awt.event.*;
public class adminMenu extends JFrame{
public static void main (String args[]){
//adminMenu gui= new adminMenu ();
//gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//gui.setTitle("Admin Menu");
}
JButton btnManageUsers= new JButton("Manage Users");
JButton btnAccessHistory= new JButton("Access History");
public adminMenu (String name){
setLayout (null);
setTitle("Amin Area");
JLabel lblWelcome= new JLabel ("Welcome to the Admin Area " + name);
lblWelcome.setBounds(100,0,300,30);
add(lblWelcome);
btnManageUsers.setBounds(120,70, 150, 30);
add(btnManageUsers);
btnAccessHistory.setBounds(120,130, 150, 30);
add(btnAccessHistory);
}
public void calcButtons()
{
btnAccessHistory.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
accessHistory gui =new accessHistory();
gui.setSize (360, 450);
gui.setLocationRelativeTo(null);
gui.setVisible(true);
dispose();
}
});
}
}