Изменил(а) на 'FormBattleship.java'

This commit is contained in:
Zhelovanov_Dmitrii 2022-12-22 22:25:29 +04:00
parent 9cce5599bf
commit 635427fed8

View File

@ -31,7 +31,7 @@ public class FormBattleship extends JComponent {
createButton.addActionListener(e -> {
Random rnd = new Random();
Color colorFirst = JColorChooser.showDialog(null, "Color", new Color(rnd.nextInt(256), rnd.nextInt(256),rnd.nextInt(256)));
Color colorFirst = JColorChooser.showDialog(null, "Цвет", new Color(rnd.nextInt(256), rnd.nextInt(256),rnd.nextInt(256)));
_battleship = new DrawningBattleship(rnd.nextInt(100, 300), rnd.nextInt(1000, 2000),
colorFirst);
_battleship.SetPosition(10 + rnd.nextInt(90), 10 + rnd.nextInt(90), getWidth(), getHeight() - 75);
@ -45,8 +45,8 @@ public class FormBattleship extends JComponent {
JButton modifiedButton = new JButton("Модификация");
modifiedButton.addActionListener(e -> {
Random rnd = new Random();
Color colorFirst = JColorChooser.showDialog(null, "Color", new Color(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));
Color colorSecond = JColorChooser.showDialog(null, "Color", new Color(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));
Color colorFirst = JColorChooser.showDialog(null, "Цвет", new Color(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));
Color colorSecond = JColorChooser.showDialog(null, "Цвет", new Color(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)));
_battleship = new DrawningLinkor(rnd.nextInt(200) + 100, rnd.nextInt(1000) + 1000,
colorFirst, colorSecond, rnd.nextBoolean(), rnd.nextBoolean());
_battleship.SetPosition(10 + rnd.nextInt(90), 10 + rnd.nextInt(90), getWidth(), getHeight() - 75);