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...

[2340 byte] By [coolprosua] at [2007-11-27 5:30:48]
# 1
Works fine for me using JDK1.4.2 on XP.
camickra at 2007-7-12 14:55:23 > top of Java-index,Desktop,Core GUI APIs...
# 2
I use jdk1.5 on Xp. Ok, I'll check it again
coolprosua at 2007-7-12 14:55:23 > top of Java-index,Desktop,Core GUI APIs...