-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
x86
-
windows_nt
Name: gsC80088 Date: 01/26/99
At first, I noticed that when I had a JTextArea
inside a JInternalFrame inside a desktop inside a
JWindow, the caret wasn't flashing. I could type
text fine, but no caret. When I put everything
inside a JFrame instead, the caret displayed
properly.
The reason I think the problem is with XOR-mode
drawing is that I had written a console bean that
handles its own cursor, via XOR-mode drawing,
and I had the same problem: no caret display
unless everything resided inside a JFrame instead
of a JWindow.
Here's code to demonstrate:
(Try typing in the text area)
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class NoCaretDemo implements Runnable {
public static void main(String[] args) {
new Thread(new NoCaretDemo()).start();
}
public void run() {
JWindow window = new JWindow();
window.setSize(window.getToolkit().getScreenSize());
window.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent evt) {
evt.getWindow().dispose();
System.exit(0);
}
});
JDesktopPane desktop = new JDesktopPane();
window.getContentPane().add(desktop);
window.show();
JInternalFrame frame = new JInternalFrame("Text Area", true, true, true, true);
frame.getContentPane().add(new JTextArea(5, 10), BorderLayout.CENTER);
frame.pack();
desktop.add(frame, JDesktopPane.DEFAULT_LAYER);
}
}
(Review ID: 47701)
======================================================================
- duplicates
-
JDK-4254005 JTextField gets no focus in JWindow
-
- Closed
-