Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JOptionPane Input Dialog is blank

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm hoping that A) this is the right form and B) this is not a duplicate question. I didn't find anything exactly like it in a search.

Anyway, I'm new to Java and working on examples inmy schoolbook. When I run the code below, I get a blank window titled "Input". My only options are to Enter through the inputs, at which point I get a NumberFormatException because I haven't entered any numbers. I think my problem might have something to do with my Java versions. I believe I'm running 1.4.2, but 1.5 is installed on my system as well.

Can anyone help? Thanks!

 
Marshal
Posts: 75702
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and what are you writing in the blank space on the input dialogue?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
must be the version...

I compiled and ran using 1.5.0_07 and it worked just fine
 
Maureen Augustus
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, I'll have to figure out why it doesn't like 1.4.2. I got the example from a book written for 1.3, so I would think it wouldn't require a later version. Unfortunately, I need to learn 1.4.2 specifically, since that is the version used on the program I was hired to maintain and word here is that there are no plans to upgrade to 5 or 6 anytime soon.

Campbell, to answer your question, I would type an integer in the dialog if it showed a box in which to do so. However, the entire dialog is blank.

Thanks for your help, guys.
 
Scott Cook
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe they would let you install 1.5 in your local area, just to see if it works?

Either that or re-install 1.4.2

All I know is that your code is fine, so there must be something wrong with your environment or JVM

Scott
 
Campbell Ritchie
Marshal
Posts: 75702
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Scott Cook is right.
 
Maureen Augustus
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case anyone's still interested, I got the answer to this problem from someone on the Sun forums. I had to reduce my graphics acceleration by about three notches to make it work.

Thanks for your help!
 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic