• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Lanny Gilbert
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • 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: 132
  • Mark post as helpful
  • send pies
  • 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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK for me win98se, java 1.4.0_01

try this simple example
 
Lanny Gilbert
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • 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...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!