Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Methods in an additional *.JAVA file

Status
Not open for further replies.

stonee74

Technical User
Nov 12, 2001
49
CH
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
 
ok guys, it works, don't need your help that time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top