• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Backspace key doesn't work when using JOptionPane.showInputDialog from an applet

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an applet which uses JOptionPane.showInputDialog() to get input from a user. Problem is, the backspace key doesn't work within the input area of the Dialog box that is popped.

I know that I somehow need to rebind the backspace key because the dialog is being popped from an Applet, but since showInputDialog is a static method, I don't know how to go about this.

Here's my code...

inputValue = JOptionPane.showInputDialog(this,messageStr,initialValueStr);

Any ideas?
 
Lanny Gilbert
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing I forgot to mention... I put this same code in a standalone program that uses a JFrame and the backspace key works fine, so I know it's because of the Applet.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
works OK for me win98se, java 1.4.0_01

try this simple example
 
Lanny Gilbert
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep. That works also.. I guess my problem is deeper than that. I'm popping the dialog from inside a JPanel that contains a class derived from JLayeredPane. It must be the JLayeredPane that's causing the backspace not to work.. I'll continue investigating...
 
Whatever you say buddy! And I believe this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic