Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #15657
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: It doesn't see my 'if' statements |
| Date | 2012-06-27 03:16 -0700 |
| Organization | Canadian Mind Products |
| Message-ID | <r5nlu794ai9eac8l036vg6e8138lgnrufo@4ax.com> (permalink) |
| References | <jsde9p$ebg$1@dont-email.me> |
On Tue, 26 Jun 2012 15:49:29 -0700, bilsch <bilsch01@gmail.com> wrote, quoted or indirectly quoted someone who said : >A stripped down version of my program is in the 2 files copied below. >It is a simple calculator like in Windows accessories. The example only >does addition and subtraction but it doesn't work. A number is >accumulated in the textbox and when '+' button is clicked the displayed >string is converted to double, the displayed string remains until the >first digit of the next number is entered then the first number is >cleared and the second number begins. When '=' is clicked the second >displayed string (number) is converted to double and added to the first >double number. The operation is controlled by 'opFlag' and 'addFlag' >settings. The problem apparently is that the 'if' statements that set >the flags are not being executed. I tried NetBeans debugger to watch >the values but I don't know how to use the debugger well enough. I'm >hoping someone here can tell me what I'm doing wrong so I can move on. >Your comments will be appreciated. TIA Bill S. I have not studied your program, but it sounds from your general complaint like the problem might be you don't understand that nothing gets painted until after an event handler returns. You may not appreciate why event handlers cannot dither in the least. They have to do i tiny bit of work and return, or else they will gum up the entire JVM which an only process one Swing event at a time. I suggest some background reading on events. e.g. http://mindprod.com/jgloss/event11.html -- Roedy Green Canadian Mind Products http://mindprod.com When you get stuck trying to solve a computer program: 1. Go into the kitchen and make coffee. 2. If that fails, go for a walk. 3. If that fails, take a nap. Why? To avoid being swamped with details, to see the big picture, to allow in some random noise to kick you out of your thinking rut.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll 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