CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2017
    Location
    Montreal
    Posts
    54

    Angry 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.

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Jtextfeild problems

    values in my jtext fields are not being passed off.
    What does "passed off" mean?
    Norm

  3. #3
    Join Date
    Feb 2017
    Location
    Montreal
    Posts
    54

    Azoth

    Quote Originally Posted by Norm View Post
    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.. .🤔😬

  4. #4
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    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
  •  





Click Here to Expand Forum to Full Width

Featured