Done
This commit is contained in:
parent
81e02f1e3c
commit
c76841f5e2
@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
|
@ -23,9 +23,9 @@ public class FormAirFighter {
|
||||
}
|
||||
|
||||
public FormAirFighter(){
|
||||
JFrame MonorailFrame =new JFrame ();
|
||||
JFrame AirplaneFrame =new JFrame ();
|
||||
JButton buttonCreate = new JButton("Создать");
|
||||
JButton buttonCreateLocomotive = new JButton("Создать самолет с радаром");
|
||||
JButton buttonCreateAirFighter = new JButton("Создать боевой самолёт");
|
||||
JButton buttonStep = new JButton("Шаг");
|
||||
JComboBox comboBoxStrategy = new JComboBox(
|
||||
new String[]{
|
||||
@ -98,7 +98,7 @@ public class FormAirFighter {
|
||||
}
|
||||
}
|
||||
);
|
||||
buttonCreateLocomotive.addActionListener(
|
||||
buttonCreateAirFighter.addActionListener(
|
||||
new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e){
|
||||
Random random = new Random();
|
||||
@ -151,29 +151,29 @@ public class FormAirFighter {
|
||||
}
|
||||
});
|
||||
|
||||
MonorailFrame.setSize (900, 500);
|
||||
MonorailFrame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
|
||||
MonorailFrame.setLayout(null);
|
||||
AirplaneFrame.setSize (900, 500);
|
||||
AirplaneFrame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
|
||||
AirplaneFrame.setLayout(null);
|
||||
canv = new Canvas();
|
||||
canv.setSize(pictureBoxWidth, pictureBoxHeight);
|
||||
buttonCreate.setBounds(198, 401, 180, 40);
|
||||
buttonCreateLocomotive.setBounds(12, 401, 180, 40);
|
||||
buttonCreateAirFighter.setBounds(12, 401, 180, 40);
|
||||
RightButton.setBounds(840,411,30,30);
|
||||
LeftButton.setBounds(768,411,30,30);
|
||||
UpButton.setBounds(804,375,30,30);
|
||||
DownButton.setBounds(804,411,30,30);
|
||||
comboBoxStrategy.setBounds(719,12,151,28);
|
||||
buttonStep.setBounds(768, 46, 94, 29);
|
||||
MonorailFrame.add(canv);
|
||||
MonorailFrame.add(buttonCreate);
|
||||
MonorailFrame.add(buttonCreateLocomotive);
|
||||
MonorailFrame.add(UpButton);
|
||||
MonorailFrame.add(DownButton);
|
||||
MonorailFrame.add(LeftButton);
|
||||
MonorailFrame.add(RightButton);
|
||||
MonorailFrame.add(comboBoxStrategy);
|
||||
MonorailFrame.add(buttonStep);
|
||||
MonorailFrame.setVisible(true);
|
||||
AirplaneFrame.add(canv);
|
||||
AirplaneFrame.add(buttonCreate);
|
||||
AirplaneFrame.add(buttonCreateAirFighter);
|
||||
AirplaneFrame.add(UpButton);
|
||||
AirplaneFrame.add(DownButton);
|
||||
AirplaneFrame.add(LeftButton);
|
||||
AirplaneFrame.add(RightButton);
|
||||
AirplaneFrame.add(comboBoxStrategy);
|
||||
AirplaneFrame.add(buttonStep);
|
||||
AirplaneFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
class Canvas extends JComponent{
|
||||
|
Loading…
Reference in New Issue
Block a user