Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15639

Re: It doesn't see my 'if' statements

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!204.52.135.9.MISMATCH!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!multikabel.net!newsfeed20.multikabel.net!eweka.nl!lightspeed.eweka.nl!69.16.177.246.MISMATCH!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!npeersf03.am4!fx10.am4.POSTED!not-for-mail
From Mike Winter <usenet@michael-winter.me.invalid>
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: It doesn't see my 'if' statements
References <jsde9p$ebg$1@dont-email.me> <jsdefq$ek9$1@dont-email.me> <3a22d9ec-dc33-4443-aec2-9dee3bd62dbf@googlegroups.com> <jsdjom$fic$1@dont-email.me>
In-Reply-To <jsdjom$fic$1@dont-email.me>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 31
Message-ID <o_sGr.321702$3i1.7177@fx10.am4> (permalink)
NNTP-Posting-Host 77.103.78.83
X-Complaints-To http://netreport.virginmedia.com
X-Trace fx10.am4 1340759060 77.103.78.83 (Wed, 27 Jun 2012 01:04:20 UTC)
NNTP-Posting-Date Wed, 27 Jun 2012 01:04:20 UTC
Organization virginmedia.com
Date Wed, 27 Jun 2012 02:04:22 +0100
X-Received-Bytes 2025
Xref csiph.com comp.lang.java.programmer:15639

Show key headers only | View raw


On 27/06/2012 01:22, bilsch wrote:

>>> On 6/26/2012 3:49 PM, bilsch wrote:
>>>
>>>> public void actionPerformed(ActionEvent event){
>>>>        String btn = event.getActionCommand();
>>>>              // opflag clears display
>>>>              if (opFlag = true){

[snip]

> I changed the opFlag and addFlag statements and it STILL doesn't work.

There's also the subFlag condition (and ideally using the equals method 
for comparison as mentioned in <jsd9cf$hha$1@dont-email.me>), but 
another, significant problem is to do with your program's logic as you 
don't reset the state of the String, strng1, or output the computed value.

After an addition or subtraction operation, you need to reset your 
string so that you start building the next operand, not a concatenation 
of the first /and/ second operands. You also need to set the JTextField 
text to the (type-converted) value of operand1 when requesting the total.

Kind regards,
Mike

-- 
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

It doesn't see my 'if' statements bilsch <bilsch01@gmail.com> - 2012-06-26 15:49 -0700
  Re: It doesn't see my 'if' statements markspace <-@.> - 2012-06-26 15:52 -0700
    Re: It doesn't see my 'if' statements Lew <lewbloch@gmail.com> - 2012-06-26 16:40 -0700
      Re: It doesn't see my 'if' statements bilsch <bilsch01@gmail.com> - 2012-06-26 17:22 -0700
        Re: It doesn't see my 'if' statements Mike Winter <usenet@michael-winter.me.invalid> - 2012-06-27 02:04 +0100
    Re: It doesn't see my 'if' statements Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-26 23:44 +0000
      Re: It doesn't see my 'if' statements bilsch <bilsch01@gmail.com> - 2012-06-26 17:18 -0700
    Re: It doesn't see my 'if' statements bilsch <bilsch01@gmail.com> - 2012-06-26 17:04 -0700
      Re: It doesn't see my 'if' statements markspace <-@.> - 2012-06-26 19:47 -0700
  Re: It doesn't see my 'if' statements Roedy Green <see_website@mindprod.com.invalid> - 2012-06-27 03:16 -0700

csiph-web