lab4 some minor fixes
This commit is contained in:
parent
22c6e38b92
commit
234aa190c8
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user