mercredi 20 mai 2015
brauche hilfe bei Fehlersuche
Posted on 07:41 by verona
Hallo ich bin gerade dabei einen Formelrechner zu bauen und bekomme an folgender Stelle immer einen Fehler mit dem ich nix anfangen kann.
Formel für n!
Die Gui dazu
und der Controller
Der Fehler liegt bei
Ich weis echt nicht was da das Problem sein soll :(
Formel für n!
Java Code:
-
public class Fakultaet {
-
-
-
double Fergebnis;
-
-
-
public void fakultaet(int n){
-
double zERG=1;
-
for(int i=n;i>0;i--){
-
zERG*=i;
-
Fergebnis = zERG;
-
}
-
}
-
public double getErgbenis(){
-
return Fergebnis;
-
}
-
-
}
-
]
Die Gui dazu
Java Code:
-
import java.awt.event.ActionListener;
-
-
import javax.swing.JButton;
-
import javax.swing.JFrame;
-
import javax.swing.JPanel;
-
import javax.swing.JTextField;
-
import javax.swing.border.EmptyBorder;
-
-
-
/**
-
*
-
*/
-
private static final long serialVersionUID = 1L;
-
-
-
public BernoulliGUI() {
-
-
super("Bernoulli");
-
-
Form_bermoulli();
-
}
-
-
-
public void Form_bermoulli() {
-
setBounds(100, 100, 450, 300);
-
setContentPane(panel);
-
panel.setLayout(null);
-
-
nVariable.setBounds(27, 12, 114, 19);
-
panel.add(nVariable);
-
nVariable.setColumns(10);
-
-
zurückBb.setBounds(319, 224, 117, 25);
-
panel.add(zurückBb);
-
-
Nfack.setBounds(265, 9, 117, 25);
-
panel.add(Nfack);
-
-
ResetB.setBounds(265, 58, 117, 25);
-
panel.add(ResetB);
-
-
fackErgebnis.setBounds(27, 169, 114, 19);
-
panel.add(fackErgebnis);
-
fackErgebnis.setColumns(10);
-
}
-
-
-
-
-
-
-
return this.nVariable.getText();
-
-
}
-
-
-
this.fackErgebnis.setText(erg);
-
-
}
-
-
this.Nfack.addActionListener(l);
-
-
}
-
-
-
this.zurückBb.addActionListener(l);
-
}
-
}
und der Controller
Java Code:
-
public class Controller {
-
-
private PlusGUI Plusgui;
-
private StartGUI Startgui;
-
private Addition addition;
-
private BernoulliGUI bernoulligui;
-
private Bernoulli bernoulliRechner;
-
-
public Controller(){
-
-
this.Plusgui = new PlusGUI();
-
this.addition = new Addition();
-
this.Startgui = new StartGUI();
-
this.bernoulligui = new BernoulliGUI();
-
-
-
-
addListener();
-
}
-
-
public void showGUI(){
-
this.Plusgui.setVisible(false);
-
this.Startgui.setVisible(true);
-
this.bernoulligui.setVisible(false);
-
-
}
-
-
-
-
private void addListener(){
-
-
this.Plusgui.setAdditionListener(new AdditionListener());
-
this.Plusgui.setResetFormListener(new ResetFormListener());
-
this.Plusgui.setStartGUIListener(new StartGUIListener());
-
this.Startgui.setAddGUIListener(new AddGUIListener());
-
this.Startgui.setBernoulliguiListener(new BernoulliguiListener());
-
this.bernoulligui.setStartGUIListener(new StartGUIListener());
-
this.bernoulligui.setBernoulliListener(new BernoulliListener());
-
}
-
-
-
bernoulliRechner.fakultaet(n);
-
}
-
-
}
-
-
-
addition.additionBerechnen(aaWert, bbWert);
-
}
-
}
-
-
-
-
Plusgui.resetAdditionGUI();
-
addition.zurückSetzen();
-
bernoulligui.resetBernoulliGUI();
-
-
}
-
}
-
-
-
Startgui.setVisible(true);
-
Plusgui.setVisible(false);
-
bernoulligui.setVisible(false);
-
-
}
-
}
-
-
-
Startgui.setVisible(false);
-
Plusgui.setVisible(true);
-
bernoulligui.setVisible(false);
-
-
}
-
}
-
-
Startgui.setVisible(false);
-
Plusgui.setVisible(false);
-
bernoulligui.setVisible(true);
-
}
-
}
-
}]
Der Fehler liegt bei
Java Code:
-
at controller.Controller$BernoulliListener.actionPerformed(Controller.java:46)
Ich weis echt nicht was da das Problem sein soll :(
brauche hilfe bei Fehlersuche
Categories: brauche hilfe bei Fehlersuche
Inscription à :
Publier les commentaires (Atom)
0 commentaires:
Enregistrer un commentaire