Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: It doesn't see my 'if' statements Date: Tue, 26 Jun 2012 16:40:21 -0700 (PDT) Organization: http://groups.google.com Lines: 25 Message-ID: <3a22d9ec-dc33-4443-aec2-9dee3bd62dbf@googlegroups.com> References: NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1340754021 17066 127.0.0.1 (26 Jun 2012 23:40:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 26 Jun 2012 23:40:21 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:15630 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)'. -- Lew