Text cursor not showing
Hi
When I add a JEditorPane to a frame, the cursor changes to text cursor (Cursor.TEXT_CURSOR) when the mouse enters the text area. However when I add a JEditorPane to a dialog box, the cursor does not change anymore
Here are the two codes:
import javax.swing.*;
publicclass JTextEditorExample{
publicstaticvoid main(String args[])
{
JFrame frame =new JFrame();
frame.setSize(400,400);
frame.add(new JEditorPane());
frame.setVisible(true);
}
}
In this case, the mouse cursor changes properly on entering the text area but in the following code, it doesn't
import javax.swing.*;
publicclass JTextEditorProblemExample{
publicstaticvoid main(String args[])
{
JFrame frame =new JFrame();
frame.setSize(400,400);
frame.setVisible(true);
MyDialog diag =new MyDialog();
diag.setVisible(true);
}
}
class MyDialogextends JDialog{
MyDialog(){
setSize(300,300);
JEditorPane text =new JEditorPane();
add(text);
}
}
I want the cursor to change in case of the second example too because in my project, I am adding a JEditorPane to a dialog box. Can anyone come up with a solution? Thanks in advance...

