Oprogramowany przycisk usuń - usuwanie ostatniego pasażera

This commit is contained in:
Tomasz Piechucki 2011-05-03 16:22:01 +00:00
parent bf8b82ad9a
commit 3de82aa1ba
2 changed files with 6 additions and 1 deletions

View file

@ -819,7 +819,7 @@ public class WindaView extends FrameView{
}//GEN-LAST:event_jSpinner6StateChanged
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// TODO add your handling code here:
w.UsunOstatniegoPasazera();
}//GEN-LAST:event_jButton6ActionPerformed
private void jSpinner7StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner7StateChanged

View file

@ -102,6 +102,11 @@ public class Winda {
log = new Logger(this.Trasa);
}
public void UsunOstatniegoPasazera(){
this.pasazerowieCollection.remove(this.pasazerowieCollection.size()-1);
this.IloscPasazerow --;
}
public static void main(String[] args) {
Winda w = new Winda();