From 5508315dd2f09e3f09abf4f1aa4254868c793776 Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Tue, 7 Nov 2023 16:05:40 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BE?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FormContainerShip.java | 1 - FormShipCollection.java | 23 +++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/FormContainerShip.java b/FormContainerShip.java index 4cf8a2b..111191d 100644 --- a/FormContainerShip.java +++ b/FormContainerShip.java @@ -181,7 +181,6 @@ public class FormContainerShip{ right.addActionListener(actioListener); w.setSize (1000, 600); - w.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); w.setLayout(null); canv = new Canvas(); canv.setBounds(0, 0, 1000, 600); diff --git a/FormShipCollection.java b/FormShipCollection.java index 381f0ab..3f4b540 100644 --- a/FormShipCollection.java +++ b/FormShipCollection.java @@ -149,9 +149,8 @@ public class FormShipCollection { return; } FormContainerShip form = new FormContainerShip(); - form._drawingShip = removedShips.peek(); + form._drawingShip = removedShips.pop(); form._drawingShip.SetPosition(100, 100); - removedShips.pop(); form.Draw(); } } @@ -203,17 +202,17 @@ public class FormShipCollection { w.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); w.setLayout(null); canv.setBounds(0, 0, pictureBoxWidth, pictureBoxHeight); - ButtonAddShip.setBounds(pictureBoxWidth, 0, 120, 20); - TextBoxNumber.setBounds(pictureBoxWidth, 50, 120, 20); - ButtonDeleteShip.setBounds(pictureBoxWidth, 80, 120, 20); - ButtonRefreshCollection.setBounds(pictureBoxWidth, 120, 120, 20); - forNewForm.setBounds(pictureBoxWidth, 150, 120, 20); + ButtonAddShip.setBounds(pictureBoxWidth, 0, 130, 20); + TextBoxNumber.setBounds(pictureBoxWidth, 50, 130, 20); + ButtonDeleteShip.setBounds(pictureBoxWidth, 80, 130, 20); + ButtonRefreshCollection.setBounds(pictureBoxWidth, 130, 120, 20); + forNewForm.setBounds(pictureBoxWidth, 150, 130, 20); - buttonAddSet.setBounds(pictureBoxWidth, 180, 120, 20); - textBoxSetName.setBounds(pictureBoxWidth, 210, 120, 20); - jListStorage.setBounds(pictureBoxWidth, 240, 120, 60); - buttonRemoveSet.setBounds(pictureBoxWidth, 310, 120, 20); - buttonGetRemoved.setBounds(pictureBoxWidth, 340, 120, 20); + buttonAddSet.setBounds(pictureBoxWidth, 180, 130, 20); + textBoxSetName.setBounds(pictureBoxWidth, 210, 130, 20); + jListStorage.setBounds(pictureBoxWidth, 240, 130, 60); + buttonRemoveSet.setBounds(pictureBoxWidth, 310, 130, 20); + buttonGetRemoved.setBounds(pictureBoxWidth, 340, 130, 20); w.add(canv); w.add(ButtonAddShip); w.add(ButtonDeleteShip);