Initial Commit. LabWork02 started

This commit is contained in:
Данила Мочалов 2022-10-08 16:09:23 +04:00
parent ac9d6db704
commit 8e2dd53ece

View File

@ -55,25 +55,25 @@ public class FormLocomotive extends JComponent{
statusPanel.add(weightLabel);
statusPanel.add(colorLabel);
JButton moveDownButton = new JButton("Down");
JButton moveDownButton = new JButton("D");
moveDownButton.addActionListener(e -> {
if (_locomotive != null) _locomotive.MoveTransport(Direction.Down);
repaint();
});
JButton moveUpButton = new JButton("Up");
JButton moveUpButton = new JButton("U");
moveUpButton.addActionListener(e -> {
if (_locomotive != null) _locomotive.MoveTransport(Direction.Up);
repaint();
});
JButton moveLeftButton = new JButton("Left");
JButton moveLeftButton = new JButton("L");
moveLeftButton.addActionListener(e -> {
if (_locomotive != null) _locomotive.MoveTransport(Direction.Left);
repaint();
});
JButton moveRightButton = new JButton("Right");
JButton moveRightButton = new JButton("R");
moveRightButton.addActionListener(e -> {
if (_locomotive != null) _locomotive.MoveTransport(Direction.Right);
repaint();
@ -96,6 +96,6 @@ public class FormLocomotive extends JComponent{
}
public static void main(String[] args) {
FormLocomotive formLocomotive = new FormLocomotive();
new FormLocomotive();
}
}