急!大家帮我看一下这个程序怎么回事?

kangbazifage 2011-05-24 05:07:20
中午还好好的能运行,突然不行了,大家帮我看一下,在线等等.........


package Fly;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Flymain extends JFrame
{

private JMenuBar mb;
public JMenu system,info,help;
private JMenuItem gaimi,tuichu,dingpiao,gaiqian,tuipiao,
chaxun,about;
public MyQuery query;
public TuiPiao tui;
public Flymain()
{

super("长治学院订票系统");
ImageIcon image = new ImageIcon("Fly\\Fly\\junshi001.jpg");
JLabel jb=new JLabel(image);
this.add(jb);
Container c=getContentPane();
mb=new JMenuBar();
Font fnt=new Font("Dialog",Font.BOLD+Font.PLAIN,16);
Font fnt1=new Font("Serief",Font.ITALIC,16);
system=new JMenu("系统");
info=new JMenu("信息");
//info.setEnabled(false);
help=new JMenu("帮助");
//denglu=new JMenuItem("登录");
gaimi=new JMenuItem("改密");
tuichu=new JMenuItem("退出");
dingpiao=new JMenuItem("订票");
gaiqian=new JMenuItem("改签");
tuipiao=new JMenuItem("退票");
chaxun=new JMenuItem("查询");
//data1=new JMenuItem("数据管理");
/*insert=new JMenuItem("数据插入");
delete=new JMenuItem("数据删除");
quer=new JMenuItem("数据查询");
update=new JMenuItem("数据更新");
about=new JMenuItem("关于");*/
//denglu.addActionListener(new Handle1());
tuichu.addActionListener(new Handle1());
chaxun.addActionListener(new Handle1());
dingpiao.addActionListener(new Handle1());
gaiqian.addActionListener(new Handle1());
tuipiao.addActionListener(new Handle1());
//data1.addActionListener(new Handle1());

//update.addActionListener(new Handle1());
about.addActionListener(new Handle1());
mb.add(system);
mb.add(info);
mb.add(help);
system.setFont(fnt);
info.setFont(fnt);
//data1.setFont(fnt);
help.setFont(fnt);
//system.add(denglu);
system.add(gaimi);
system.add(tuichu);
info.add(dingpiao);
info.add(gaiqian);
info.add(tuipiao);
info.add(chaxun);
/* data.add(quer);
data.add(insert);
data.add(delete);
data.add(update);*/
help.add(about);
//denglu.setFont(fnt1);
gaimi.setFont(fnt1);
tuichu.setFont(fnt1);
dingpiao.setFont(fnt1);
tuipiao.setFont(fnt1);
chaxun.setFont(fnt1);
about.setFont(fnt1);
gaiqian.setFont(fnt1);
//data1.setFont(fnt1);
// update.setFont(fnt1);
// delete.setFont(fnt1);
// quer.setFont(fnt1);
//insert.setFont(fnt1);
setJMenuBar(mb);
setSize(800, 600);
setLocation(100,20);
setVisible(true);
}
public void infox()
{
info.setEnabled(true);
}
public static void main(String args[])
{
Flymain menu=new Flymain();
}
class Handle1 implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
//Denglu deng1=new Denglu();
JMenuItem x=(JMenuItem) e.getSource();
if(x==tuichu){
setVisible(false);
System.exit(0);}
else if(x==chaxun)
{
query=new MyQuery();
query.setSize(470,370);
//query.setResizable(false);
query.setLocation(300,120);
query.setTitle("航班查询系统");
query.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
query.setVisible(true);
}
else if(x==tuipiao)
{
tui=new TuiPiao();
tui.setSize(470,370);
//tui.setResizable(false);
tui.setLocation(300,100);
tui.setTitle("航班退票系统");
tui.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
tui.setVisible(true);
}
else if(x==dingpiao)
{

Hangkong ding = new Hangkong();
ding.setSize(470,370);
//ding.setResizable(false);
ding.setLocation(300,100);
ding.setTitle("航班订票系统");
ding.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
ding.setVisible(true);
}
/*else if(x==data1)
{
TestDB manager = new TestDB();

manager.setSize(470,370);
manager.setResizable(false);
manager.setTitle("航班管理系统");
manager.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
manager.setVisible(true);
}*/
else if(x==about)
{
String information = "制作人:" + " 吴江川 杨捷 马亮亮 王新玉" + "\n" +
"版本: " + " 0.1" + "\n" +
"时间: " + " 2011-5" + "\n" +
"地址: " + " 长治学院计算机系计科0801班";

JOptionPane.showMessageDialog(null,information,"关于",JOptionPane.INFORMATION_MESSAGE);
}
}
}
}
...全文
77 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kangbazifage 2011-05-24
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 yetaodiao 的回复:]
system.in能给个值么
[/Quote]
谢了,我解决了
  • 打赏
  • 举报
回复
system.in能给个值么
kangbazifage 2011-05-24
  • 打赏
  • 举报
回复
这个是在Eclipse下运行的提示错误


Exception in thread "main" java.lang.NullPointerException
at Fly.Flymain.<init>(Flymain.java:51)
at Fly.Flymain.main(Flymain.java:102)

58,441

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧