📄 small_air_craft.java
字号:
button22.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[6]=new seat("aisle","1C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label7.setText(information2);
button22.setBackground(Color.yellow);
label7.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[6].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label7.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button22.setBackground( Color.green);
label7.setForeground(Color.red);
label7.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }
});
//
button25.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[9]=new seat("aisle","1F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label10.setText(information2);
button25.setBackground(Color.yellow);
label10.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[9].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label10.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button25.setBackground( Color.green);
label10.setForeground(Color.red);
label10.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button26.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[10]=new seat("window","1G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label11.setText(information2);
button26.setBackground(Color.yellow);
label11.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[10].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label11.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button26.setBackground( Color.green);
label11.setForeground(Color.red);
label11.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
// /////////////////////////////////////////
button27.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[11]=new seat("window","2A");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label12.setText(information2);
button27.setBackground(Color.yellow);
label12.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[11].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label12.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button27.setBackground( Color.green);
label12.setForeground(Color.red);
label12.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button28.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[12]=new seat("aisle","2B");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label13.setText(information2);
button28.setBackground(Color.yellow);
label13.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[12].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label13.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button28.setBackground( Color.green);
label13.setForeground(Color.red);
label13.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }
});
button29.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[13]=new seat("aisle","2C");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label14.setText(information2);
button29.setBackground(Color.yellow);
label14.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[13].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label14.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button29.setBackground( Color.green);
label14.setForeground(Color.red);
label14.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button32.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[16]=new seat("aisle","2F");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label18.setText(information2);
button32.setBackground(Color.yellow);
label18.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[16].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label18.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button32.setBackground( Color.green);
label18.setForeground(Color.red);
label18.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button33.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[17]=new seat("window","2G");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label19.setText(information2);
button33.setBackground(Color.yellow);
label19.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[17].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label19.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button33.setBackground( Color.green);
label19.setForeground(Color.red);
label19.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
// ////////////////////////////////////////////////
button34.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[18]=new seat("window","3A");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label20.setText(information2);
button34.setBackground(Color.yellow);
label20.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[18].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("clear")==0)
{
label20.setText("");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num++;
jt2.setText("remain seats number: "+num);
}
else if(information2.compareTo("book")==0)
{
button34.setBackground( Color.green);
label20.setForeground(Color.red);
label20.setText("book");
jt5.setText("" );
jt1.setText("" );
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
} }});
button35.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent event)
{
oneseat[19]=new seat("aisle","3B");
String information2 =JOptionPane.showInputDialog("please decide do u want to buy or booked");
if(information2.compareTo("buy")==0)
{ label21.setText(information2);
button35.setBackground(Color.yellow);
label21.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[19].toString());
jt1.setEditable( true);
num--;
jt2.setText("remain seats number: "+num);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -