Форма + словарь
This commit is contained in:
parent
9f67e71ca9
commit
4139b082ae
3
WarmlyLocomotive/src/DirectionType.java
Normal file
3
WarmlyLocomotive/src/DirectionType.java
Normal file
@ -0,0 +1,3 @@
|
||||
public enum DirectionType {
|
||||
Up, Down, Right, Left;
|
||||
}
|
@ -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;
|
||||
|
26
WarmlyLocomotive/src/FormWarmlyLocomotive.java
Normal file
26
WarmlyLocomotive/src/FormWarmlyLocomotive.java
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
|
||||
public class Program {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello, World!");
|
||||
FormWarmlyLocomotive form = new FormWarmlyLocomotive();
|
||||
form.Initialize();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user