This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane Input Dialog is blank

 
Maureen Augustus
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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!

 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and what are you writing in the blank space on the input dialogue?
 
Scott Cook
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Scott Cook is right.
 
Maureen Augustus
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic