Форма + словарь

This commit is contained in:
Данил Лопатин 2024-02-18 15:45:11 +03:00
parent 9f67e71ca9
commit 4139b082ae
4 changed files with 37 additions and 4 deletions

View File

@ -0,0 +1,3 @@
public enum DirectionType {
Up, Down, Right, Left;
}

View File

@ -20,10 +20,12 @@ public class EntityWarmlyLocomotive {
private boolean FuelTank;
public boolean getFuelTank() { return FuelTank; }
public double Step = Speed * 100 / Weight;
public double Step() {
return Speed * 100 / Weight;
}
public void Init(int speed, double weight, Color bodyColor, Color
additionalColor, boolean tube, boolean fuelTank)
public void Init(int speed, double weight, Color bodyColor, Color
additionalColor, boolean tube, boolean fuelTank)
{
Speed = speed;
Weight = weight;

View File

@ -0,0 +1,26 @@
import javax.swing.*;
public class FormWarmlyLocomotive extends JFrame {
public void Initialize(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(900, 500);
setVisible(true);
setTitle("Тепловоз");
setResizable(false);
//pictireBox
JPanel pictureBox = new JPanel();
pictureBox.setSize(getWidth(), getHeight());
pictureBox.setLayout(null);
//createButton
JButton createButton = new JButton("Создать");
createButton.setBounds(20, 420, 90, 25);
pictureBox.add(createButton);
add(pictureBox);
}
}

View File

@ -1,5 +1,7 @@
public class Program {
public static void main(String[] args) {
System.out.println("Hello, World!");
FormWarmlyLocomotive form = new FormWarmlyLocomotive();
form.Initialize();
}
}