diff --git a/src/FormAirFighter.java b/src/FormAirFighter.java index d9b068c..a9e340e 100644 --- a/src/FormAirFighter.java +++ b/src/FormAirFighter.java @@ -36,7 +36,7 @@ public class FormAirFighter { canv.repaint(); } public void ChangeAirplane(DrawningAirplane newAirplane){ - newAirplane.SetPosition(0,0); + newAirplane.SetPosition(0,70); DrawningAirplane = newAirplane; canv.DrawningAirplane = DrawningAirplane; diff --git a/src/FormAirFighterCollection.java b/src/FormAirFighterCollection.java index 4d27689..d943257 100644 --- a/src/FormAirFighterCollection.java +++ b/src/FormAirFighterCollection.java @@ -107,8 +107,8 @@ public class FormAirFighterCollection { if(_trashCollection.GetSize() == 0) return; FormAirFighter form = new FormAirFighter(); - form.ChangeAirplane(_trashCollection.GetTop()); - _trashCollection.Pop(); + form.ChangeAirplane(_trashCollection.Pop()); + } }); addButton.addActionListener(new ActionListener() { diff --git a/src/Generics/AirplaneTrashCollection.java b/src/Generics/AirplaneTrashCollection.java index 37374a9..e0bcf44 100644 --- a/src/Generics/AirplaneTrashCollection.java +++ b/src/Generics/AirplaneTrashCollection.java @@ -20,13 +20,7 @@ public class AirplaneTrashCollection { return _queue.size(); } - public void Pop(){ - if(_queue.size() ==0) - return; - _queue.remove(); - } - - public T GetTop(){ - return _queue.peek(); + public T Pop(){ + return _queue.remove(); } }