Hey there
I am new in JAVA, and got a simple question.
I wrote the following class:
public class Calc {
public Calc() {
}
public static double Conversion (float from, String Start, String Ziel){
float result;
if ((Start == "W" && (Ziel == "kW"){
result = from * 10;
return result;
}
else
return 0;
}
}
'from' is a textbox value, Start and Ziel are ComboboxChoices.
How can I fill a second Texbox, with the value which is coming back from my method?
I tried several things:
e.g.blabla = Conversion(Integer.parseInt(EingabeZiel.getText()),AuswahlStart.getSelectedItem(),AuswahlZiel.getSelectedItem()));
but does not work really, can anybody help me out?
thanks!
stonee
I am new in JAVA, and got a simple question.
I wrote the following class:
public class Calc {
public Calc() {
}
public static double Conversion (float from, String Start, String Ziel){
float result;
if ((Start == "W" && (Ziel == "kW"){
result = from * 10;
return result;
}
else
return 0;
}
}
'from' is a textbox value, Start and Ziel are ComboboxChoices.
How can I fill a second Texbox, with the value which is coming back from my method?
I tried several things:
e.g.blabla = Conversion(Integer.parseInt(EingabeZiel.getText()),AuswahlStart.getSelectedItem(),AuswahlZiel.getSelectedItem()));
but does not work really, can anybody help me out?
thanks!
stonee