哪位大哥帮忙调一下这个程序

来源:百度知道 编辑:UC知道 时间:2024/05/23 18:49:36
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class exam extends JFrame implements ButtonSelectedActionListener
{
JButton btnMessage=new JButton("消息");
JButton btnInput=new JButton("输入");
JButton btnConfirm=new JButton("确认");
JButton btnOption=new JButton("选择");
public exam()
{
super("exam");
btnMessage.addActionListener(this);
btnInput.addActionListener(this);
btnConfirm.addActionListener(this);
btnOption.addActionListener(this);
getContentPane().setLayout(new FlowLayout());
getContentPane().add(btnMessage);
getContentPane().add(btnInput);
getContentPane().add(btnConfirm);
getContentPane().add(btnOption);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class exam extends JFrame implements ActionListener
{
JButton btnMessage=new JButton("消息");
JButton btnInput=new JButton("输入");
JButton btnConfirm=new JButton("确认");
JButton btnOption=new JButton("选择");
public exam()
{
super("exam");
btnMessage.addActionListener(this);
btnInput.addActionListener(this);
btnConfirm.addActionListener(this);
btnOption.addActionListener(this);
getContentPane().setLayout(new FlowLayout());
getContentPane().add(btnMessage);
getContentPane().add(btnInput);
getContentPane().add(btnConfirm);
getContentPane().add(btnOption);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);

}
});
}
public static void main(String args[])
{