public void jb_tanken_ActionPerformed(ActionEvent evt) { double Menge = Double.parseDouble(jop_tankenShowInputDialog()); Auto.tanken(Menge); jtf_Tankinhalt.setText(Double.toString(Auto.Tankinhalt));}
public double Tankinhalt;public void tanken(double Menge) { if (Menge > 0) { Tankinhalt = Tankinhalt + Menge; if (Tankinhalt > Tankvolumen) { Tankinhalt = Tankvolumen; getTankinhalt(); } }}public double getTankinhalt() { return Tankinhalt;}