Need some help for a application to computation of series parallel circuits!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WanYee
    New Member
    • May 2008
    • 12

    #16
    But, where does AbstractButton comes from, or it is just an example, cause now i have them group, my idea was like
    Code:
    if(e.getSource()==jbSeries)
    		{
    seriescalculations;
    		}
    		else if(e.getSource()==jbParallel)
    		{
    parallelcalculations;
    		}

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #17
      Originally posted by WanYee
      But, where does AbstractButton comes from, or it is just an example, cause now i have them group, my idea was like
      Code:
      if(e.getSource()==jbSeries)
      		{
      seriescalculations;
      		}
      		else if(e.getSource()==jbParallel)
      		{
      parallelcalculations;
      		}
      Why do you want to register an ActionListener to the parallel/series buttons?
      Think what a user does: s/he selects one of them (nothing is supposed to happen)
      and *then* the user presses the Calculate button. The ActionListener for that
      button isn't interested what the user had done before because exactly one of
      the parallel/series buttons is selected. The ButtonGroup object took care of that.
      All it has to do is inspect which one is selected and perform its calculations.
      That's exactly what my class skeleton does and it doesn't care what button you
      are using so it uses the upper most super class for that.

      kind regards,

      Jos

      Comment

      • WanYee
        New Member
        • May 2008
        • 12

        #18
        But i don't really know how to use yours, sorry. I am researching on it soon, and NetBeans i can't type codes in it, i have to use set event to it then customize code, or am i coding in the wrong way, please guide me, thanks.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #19
          Originally posted by WanYee
          But i don't really know how to use yours, sorry. I am researching on it soon, and NetBeans i can't type codes in it, i have to use set event to it then customize code, or am i coding in the wrong way, please guide me, thanks.
          Well, research my proposal first then and come back when you have an idea
          how it works or should work. Turning proposals down or ignoring them just because
          you don't know how they work is not the way to go; the way you're coding now
          is completely off track IMHO.

          kind regards,

          Jos

          Comment

          • WanYee
            New Member
            • May 2008
            • 12

            #20
            Yeah, i know, i actually just started learning coding in Java for 2 weeks only, i will do up more research base on what you gave. Thanks, i am desperate because this is a project and the only part i am stuck is this part.

            By the way, i stated i am not sure how to do it in NetBeans your way, maybe could you like guide/explain to me, cause NetBeans has so much thing i can't add or edit, i have to customize code to edit the codes.

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #21
              Originally posted by WanYee
              Yeah, i know, i actually just started learning coding in Java for 2 weeks only, i will do up more research base on what you gave. Thanks, i am desperate because this is a project and the only part i am stuck is this part.

              By the way, i stated i am not sure how to do it in NetBeans your way, maybe could you like guide/explain to me, cause NetBeans has so much thing i can't add or edit, i have to customize code to edit the codes.
              That can't be the meaning of an IDE such as NetBeans. Why don't you simply
              edit your .java files using a simple text editor and compile and run your classes
              using the 'javac' and 'java' command line tools? Now NetBeans is more of a
              hindrance to you than any help.

              kind regards,

              Jos

              Comment

              Working...