在类 GUI.MainMenuFrame 中找不到 main 方法

package GUI;

import java.sql.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import Function.Link;

public class MainMenuFrame {

private JFrame mf=new JFrame("学生管理系统");
private JButton studentButton=new JButton("学生信息");
private JButton courseButton=new JButton("选课信息");
private JButton gradeButton=new JButton("成绩信息");
private JButton searchButton=new JButton("查询与统计");

private PreparedStatement pstmt;
private ResultSet rs;

public void init() throws Exception{
    studentButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            studentMenu();
        }
    });
    courseButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            courseMenu();
        }
    });
    gradeButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            gradeMenu();
        }
    });
    searchButton.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            searchMenu();
        }
    });
    JPanel p1=new JPanel();
    JPanel p2=new JPanel();
    JPanel p3=new JPanel();
    JPanel p4=new JPanel();

    mf.setLayout(new GridLayout(4,1));
    p1.add(studentButton);
    p2.add(courseButton);
    p3.add(gradeButton);
    p4.add(searchButton);

    mf.add(p1);
    mf.add(p2);
    mf.add(p3);
    mf.add(p4);

    mf.pack();
    mf.setVisible(true);
}
public void studentMenu(){}
public void courseMenu(){}
public void gradeMenu(){}
public void searchMenu(){}

public static void main(String[] args) throws Exception{
    new MainMenuFrame().init();
}

}

错误: 在类 GUI.MainMenuFrame 中找不到 main 方法, 请将 main 方法定义为:
public static void main(String[] args)
否则 JavaFX 应用程序类必须扩展javafx.application.Application

查看全部
destiny_wtt
destiny_wtt
2016/06/24 12:42
  • 点赞
  • 收藏
  • 回答
    私信

0个回复