📄 small_air_craft.java
字号:
num--;
jt2.setText("remain seats number: "+num);
} }});
button49.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[33]=new seat("aisle","5B");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label35.setText(information2);
button49.setBackground(Color.yellow);
label35.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[33].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label35.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button49.setBackground( Color.green);
label35.setForeground(Color.red);
label35.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button50.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[34]=new seat("aisle","5C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label36.setText(information2);
button50.setBackground(Color.yellow);
label36.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[34].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label36.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button50.setBackground( Color.green);
label36.setForeground(Color.red);
label36.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button53.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[37]=new seat("aisle","5F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
label39.setText(information2);
if(information2.compareTo("buy")==0)
{ tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[37].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label39.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button53.setBackground( Color.green);
label39.setForeground(Color.red);
label39.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
// //////////////////////////////////////////////////////////
button54.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[38]=new seat("window","5G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label40.setText(information2);
button54.setBackground(Color.yellow);
label40.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[38].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label40.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button54.setBackground( Color.green);
label40.setForeground(Color.red);
label40.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button55.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[39]=new seat("window","6A");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label41.setText(information2);
button55.setBackground(Color.yellow);
label41.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[39].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label41.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button55.setBackground( Color.green);
label41.setForeground(Color.red);
label41.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button56.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[40]=new seat("aisle","6B");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label42.setText(information2);
button56.setBackground(Color.yellow);
label42.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[40].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label42.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button56.setBackground( Color.green);
label42.setForeground(Color.red);
label42.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button57.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[41]=new seat("aisle","6C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{
label43.setText(information2);
button57.setBackground(Color.yellow);
label43.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[41].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label43.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button57.setBackground( Color.green);
label43.setForeground(Color.red);
label43.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button61.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[45]=new seat("window","6G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label47.setText(information2);
button61.setBackground(Color.yellow);
label47.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[45].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label47.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button61.setBackground( Color.green);
label47.setForeground(Color.red);
label47.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button60.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[44]=new seat("aisle","6F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label46.setText(information2);
button60.setBackground(Color.yellow);
label46.setForeground(Color.red);
tempid=JOptionPane.showInputDialog("please input ur ID");
temp_name=JOptionPane.showInputDialog("please input ur name");
onepassager=new person(tempid,temp_name);
jt5.setText("the owner information: "+onepassager.toString() );
jt1.setText("seat infomation: "+oneseat[44].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label46.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button60.setBackground( Color.green);
label46.setForeground(Color.red);
label46.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
// ///////////////////////////////////////////////////////
}
public static void createAndShowGUI()
//throws Exception
{
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame frame2 = new JFrame("small aircraft");
frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addComponentsToPane(frame2.getContentPane());
frame2.pack();
frame2.setVisible(true);
}
//public static void get_throw()throws Exception{input.writeinfo("aa",0);throw new Exception();}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -