TextField not compatible with default button

View: New views
2 Messages — Rating Filter:   Alert me  

TextField not compatible with default button

by dcstraw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The TextField class in scala.swing adds an ActionListener to it's peer JTextField.  This prevents the enter key from activating the default button of the frame.  Since the action listener is added in the constructor, the only workaround I can think of right now is to duplicate the TextField class with my own implementation that does not add the ActionListener to the peer.  Any better ideas?

Re: [scala] TextField not compatible with default button

by Ingo Maier-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have committed a fix to trunk. Can you tell me whether that works for you?

Thanks
Ingo

dcstraw wrote:
> The TextField class in scala.swing adds an ActionListener to it's peer
> JTextField.  This prevents the enter key from activating the default button
> of the frame.  Since the action listener is added in the constructor, the
> only workaround I can think of right now is to duplicate the TextField class
> with my own implementation that does not add the ActionListener to the peer.
> Any better ideas?