Calling a method (I think?)

I'm still a bit new on the terminology. Here is what I have:

publicvoid CalcEngine ()

{

int dis = Integer.parseInt (iDis.getText ());

int rpm = Integer.parseInt (iRPM.getText ());

int ve = Integer.parseInt (iVE.getText ());

int cfm = ((dis * rpm) / 3456) * (ve) / 100;

double lbs = (((dis * rpm) / 3456) * (ve)) * 0.069 / 100;

BigDecimal bd =new BigDecimal (lbs);

bd = bd.setScale (1,BigDecimal.ROUND_UP);

lbs = bd.doubleValue ();

String tcfm = Integer.toString (cfm);

String tlbs = Double.toString (lbs);

oCFM.setText (tcfm);

oLBS.setText (tlbs);

}

I have an event that I want to call what I posted above, but I'm not quite sure how to do it nor do I know if I'm doing it right or if it's possible. I figure it is, but here is an example of what I'm trying to do:

privatevoid iVEFocusLost (java.awt.event.FocusEvent evt)

{

new CalcEngine ();

}

What would be the correct method to doing this?

[1501 byte] By [tristanlee85a] at [2007-11-27 3:18:57]
# 1
If the two methods are in the same class you would simply writeprivate void iVEFocusLost(java.awt.event.FocusEvent evt) { CalcEngine();}
brad_gillarda at 2007-7-12 8:21:36 > top of Java-index,Java Essentials,New To Java...
# 2
That was easy. I was reading in my book and I was doing it wrong. I guess they had 2 different classes and created a new object of the other class and call the method of that class. I tried doing that within the 1 class I was using and was getting exceptions, but your code works well.
tristanlee85a at 2007-7-12 8:21:36 > top of Java-index,Java Essentials,New To Java...
# 3

Hopefully you are aware that it is integer arithmentics:

int dis = Integer.parseInt (iDis.getText ());

int rpm = Integer.parseInt (iRPM.getText ());

int ve = Integer.parseInt (iVE.getText ());

int cfm = ((dis * rpm) / 3456) * (ve) / 100;

BIJ001a at 2007-7-12 8:21:37 > top of Java-index,Java Essentials,New To Java...