diff --git a/WarmlyLocomotive/src/DirectionType.java b/WarmlyLocomotive/src/DirectionType.java new file mode 100644 index 0000000..dcdeeef --- /dev/null +++ b/WarmlyLocomotive/src/DirectionType.java @@ -0,0 +1,3 @@ +public enum DirectionType { + Up, Down, Right, Left; +} diff --git a/WarmlyLocomotive/src/EntityWarmlyLocomotive.java b/WarmlyLocomotive/src/EntityWarmlyLocomotive.java index 5c23240..2034496 100644 --- a/WarmlyLocomotive/src/EntityWarmlyLocomotive.java +++ b/WarmlyLocomotive/src/EntityWarmlyLocomotive.java @@ -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; diff --git a/WarmlyLocomotive/src/FormWarmlyLocomotive.java b/WarmlyLocomotive/src/FormWarmlyLocomotive.java new file mode 100644 index 0000000..1179023 --- /dev/null +++ b/WarmlyLocomotive/src/FormWarmlyLocomotive.java @@ -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); + + } + + +} diff --git a/WarmlyLocomotive/src/Program.java b/WarmlyLocomotive/src/Program.java index 14991a8..0bb673b 100644 --- a/WarmlyLocomotive/src/Program.java +++ b/WarmlyLocomotive/src/Program.java @@ -1,5 +1,7 @@ + public class Program { public static void main(String[] args) { - System.out.println("Hello, World!"); + FormWarmlyLocomotive form = new FormWarmlyLocomotive(); + form.Initialize(); } }