PIbd-23. Zakharov R.A. Lab work 04 #5

Closed
Zakharov_Rostislav wants to merge 5 commits from Lab4 into Lab3
Showing only changes of commit 234aa190c8 - Show all commits

View File

@ -188,8 +188,7 @@ public class FrameShipsCollection extends JFrame {
pictureBoxCollection.repaint();
}
private void buttonTrashClick(){
DrawingShip ship = trashCollection.pop();
if(ship == null)
if (trashCollection.size() == 0)
return;
FrameBattleship form;
try {
@ -197,6 +196,6 @@ public class FrameShipsCollection extends JFrame {
} catch (IOException e) {
throw new RuntimeException(e);
}
form.setShip(ship);
form.setShip(trashCollection.pop());
}
}