Изменил(а) на 'FormBattleship.java'
This commit is contained in:
parent
9cce5599bf
commit
635427fed8
@ -31,7 +31,7 @@ public class FormBattleship extends JComponent {
|
|||||||
createButton.addActionListener(e -> {
|
createButton.addActionListener(e -> {
|
||||||
|
|
||||||
Random rnd = new Random();
|
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),
|
_battleship = new DrawningBattleship(rnd.nextInt(100, 300), rnd.nextInt(1000, 2000),
|
||||||
colorFirst);
|
colorFirst);
|
||||||
_battleship.SetPosition(10 + rnd.nextInt(90), 10 + rnd.nextInt(90), getWidth(), getHeight() - 75);
|
_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("Модификация");
|
JButton modifiedButton = new JButton("Модификация");
|
||||||
modifiedButton.addActionListener(e -> {
|
modifiedButton.addActionListener(e -> {
|
||||||
Random rnd = new Random();
|
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)));
|
||||||
Color colorSecond = JColorChooser.showDialog(null, "Color", 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,
|
_battleship = new DrawningLinkor(rnd.nextInt(200) + 100, rnd.nextInt(1000) + 1000,
|
||||||
colorFirst, colorSecond, rnd.nextBoolean(), rnd.nextBoolean());
|
colorFirst, colorSecond, rnd.nextBoolean(), rnd.nextBoolean());
|
||||||
_battleship.SetPosition(10 + rnd.nextInt(90), 10 + rnd.nextInt(90), getWidth(), getHeight() - 75);
|
_battleship.SetPosition(10 + rnd.nextInt(90), 10 + rnd.nextInt(90), getWidth(), getHeight() - 75);
|
||||||
|
Loading…
Reference in New Issue
Block a user