Zhelovanov D.Y. LabWork03 #3

Closed
Zhelovanov_Dmitrii wants to merge 10 commits from LabWork03 into LabWork02
Showing only changes of commit 635427fed8 - Show all commits

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);