[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/22973] swing: ClassCastException: javax/swing/JTextArea
From: |
gcc-bugzilla at gcc dot gnu dot org |
Subject: |
[Bug classpath/22973] swing: ClassCastException: javax/swing/JTextArea |
Date: |
16 Oct 2005 01:27:49 -0000 |
Steps to reproduce:
1. Compile and run the attached testcase.
2. Hit enter on the textarea.
Expected results:
1. A window shows up.
2. An empty line is added to the textarea
Actual results:
1. A window shows up
2. An empty line is added to the textarea but the program also throws the
following exception:
Exception during event dispatch:
java.lang.ClassCastException: javax/swing/JTextArea
at javax.swing.JTextField$1.actionPerformed (JTextField.java:101)
at javax.swing.SwingUtilities.notifyAction (SwingUtilities.java:1092)
at javax.swing.JComponent.processKeyBinding (JComponent.java:1824)
at javax.swing.JComponent.processKeyEvent (JComponent.java:1797)
at java.awt.Component.processEvent (Component.java:2922)
at java.awt.Container.processEvent (Container.java:841)
at java.awt.Component.dispatchEventImpl (Component.java:4779)
at java.awt.Container.dispatchEventImpl (Container.java:1539)
at java.awt.Component.dispatchEvent (Component.java:2284)
at java.awt.KeyboardFocusManager.redispatchEvent
(KeyboardFocusManager.java:1108)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent
(DefaultKeyboardFocusManager.java:274)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent
(DefaultKeyboardFocusManager.java:247)
at java.awt.EventDispatchThread.run (EventDispatchThread.java:74)
Testcase:
import javax.swing.*;
import java.awt.event.*;
public class textarea extends JFrame implements ActionListener {
public static void main(String[] args) {
(new textarea()).show();
}
public textarea() {
JTextField field = new JTextField();
field.addActionListener(this);
JTextArea area = new JTextArea(10, 40);
this.setContentPane(area);
this.pack();
}
public void actionPerformed(ActionEvent e) {
}
}
------- Comment #1 from from-classpath at savannah dot gnu dot org 2005-06-06
09:54 -------
I committed a fix for that one. Please test and report and/or close this bug.
/Roman
------- Comment #2 from from-classpath at savannah dot gnu dot org 2005-06-06
10:32 -------
Works, new lines can be added but no exception is thrown. However, I see the
following debugging statements when the program starts:
getKeymapName: MetalTextFieldUI
getKeymapName: MetalTextFieldUI
getKeymapName: BasicTextAreaUI
getKeymapName: BasicTextAreaUI
------- Comment #3 from from-classpath at savannah dot gnu dot org 2005-06-06
11:43 -------
I removed the debug statement and close this bug now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22973
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug classpath/22973] swing: ClassCastException: javax/swing/JTextArea,
gcc-bugzilla at gcc dot gnu dot org <=