-
March 11th, 2017, 06:22 PM
#1
Jtextfeild problems
I am going nuts.
Certain of my values in my jtext fields are not being passed off.
I have 4 code segments like this:
Code:
private void jC2ImTextFeildActionPerformed(java.awt.event.ActionEvent evt) {
String msg ="try again";
String im2_input=jC2reEdTextFeild.getText();
try{
im2 = Double.parseDouble(im2_input);
}catch(NumberFormatException e){JOptionPane.showMessageDialog(null,msg,"",JOptionPane.WARNING_MESSAGE);}
The first one works(this gets both re and im); it is the second one that is giving me problems(re2 and im2) and the code format is the same for all four.
The variables im,im2,re,and re2 are global .
It is the method for Im2 that does not show up. The method for re2 is iffy.
They get passed ro a calculation method say
Code:
private calccomplex(ava.awt.event.ActionEvent evt)
{
Complex c= new Complex(re,im);
Complex c1=new Complex(re2,im2);
// do complex math
}
Eveerything works great for univariate operations but as soon as I try do binary everoything
go to hell !
What can I do to make sure all re2 and im2 are passed off and don't get 0
Help !
}
}
Last edited by Azoth; March 11th, 2017 at 06:33 PM.
-
March 12th, 2017, 03:37 PM
#2
Re: Jtextfeild problems
values in my jtext fields are not being passed off.
What does "passed off" mean?
Norm
-
March 12th, 2017, 03:54 PM
#3
Azoth
Originally Posted by Norm
What does "passed off" mean?
It means the values show up as not being
0. I get 3 out of 4 being nonzero. Im2
instantiates as 0 regardless what value is
in the jeditfield.. .🤔😬
-
March 12th, 2017, 03:59 PM
#4
Re: Jtextfeild problems
Sorry, the small bits of code are not enough to show me the problem.
Can you post a small, complete program that compiles, executes and shows the problem.
Also include instructions on how to use the program to observe the problem.
Norm
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|