Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: bilsch Newsgroups: comp.lang.java.programmer Subject: Re: It doesn't see my 'if' statements Date: Tue, 26 Jun 2012 17:22:46 -0700 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <3a22d9ec-dc33-4443-aec2-9dee3bd62dbf@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 27 Jun 2012 00:22:46 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="KnXAleWiR2b1CH/F67mjfA"; logging-data="15948"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195Ezt+LzzB4LEVqkkZSasS" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <3a22d9ec-dc33-4443-aec2-9dee3bd62dbf@googlegroups.com> Cancel-Lock: sha1:Jb4ATHsDxRYvK1VhPw1RxkfSCr4= Xref: csiph.com comp.lang.java.programmer:15638 On 6/26/2012 4:40 PM, Lew wrote: > On Tuesday, June 26, 2012 3:52:41 PM UTC-7, markspace 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){ >> >> >> This is assignment, not == test. You need two == for equals testing. >> >> If you are using NetBeans, it should have flagged this with a warning. >> Mine does. > > It's also redundant. > > if (opFlag) > > is all you need. > > Otherwise you are either saying 'if (true == true)' which is the exact same logic > as 'if (true)', or 'if (false == true)', which is the same (almost) as 'if (false)'. > I changed the opFlag and addFlag statements and it STILL doesn't work. TIA Bill S.