📄 small_air_craft.java
字号:
}
else if(information2.compareTo("clear")==0)
{
label21.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button35.setBackground( Color.green);
label21.setForeground(Color.red);
label21.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button36.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[20]=new seat("aisle","3C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label22.setText(information2);
button36.setBackground(Color.yellow);
label22.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[20].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label1.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button16.setBackground( Color.green);
label1.setForeground(Color.red);
label1.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button39.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[23]=new seat("aisle","3F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label25.setText(information2);
button39.setBackground(Color.yellow);
label25.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[23].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label25.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button39.setBackground( Color.green);
label25.setForeground(Color.red);
label25.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button40.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[24]=new seat("window","3G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label26.setText(information2);
button40.setBackground(Color.yellow);
label26.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[24].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label26.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button40.setBackground( Color.green);
label26.setForeground(Color.red);
label26.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
// //////////////////////////////////////////////////
button41.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[25]=new seat("window","4A");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label27.setText(information2);
button41.setBackground(Color.yellow);
label27.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[25].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label27.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button41.setBackground( Color.green);
label27.setForeground(Color.red);
label27.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button42.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[26]=new seat("aisle","4B");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label28.setText(information2);
button42.setBackground(Color.yellow);
label28.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[26].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label28.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button42.setBackground( Color.green);
label28.setForeground(Color.red);
label28.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button43.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[27]=new seat("aisle","4C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label29.setText(information2);
button43.setBackground(Color.yellow);
label29.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[27].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label29.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button43.setBackground( Color.green);
label29.setForeground(Color.red);
label29.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
}});
button46.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[30]=new seat("aisle","4F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label32.setText(information2);
button46.setBackground(Color.yellow);
label32.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[30].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label33.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button46.setBackground( Color.green);
label33.setForeground(Color.red);
label33.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button47.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[31]=new seat("window","4G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label33.setText(information2);
button47.setBackground(Color.yellow);
label33.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[31].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label33.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button47.setBackground( Color.green);
label33.setForeground(Color.red);
label33.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button48.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[32]=new seat("window","5A");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label34.setText(information2);
button48.setBackground(Color.yellow);
label34.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[32].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
// jt3.setText("flight infomation: "+oneflight.toString() );
}
else if(information2.compareTo("clear")==0)
{
label34.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button48.setBackground( Color.green);
label34.setForeground(Color.red);
label34.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -