I’m using a JEditorPane within a JScrollPane. I’m initialising the code as follows:
jsArea = new JEditorPane();
JScrollPane scrPane = new JScrollPane(jsArea);
scrPane.setMinimumSize(new Dimension(500, 710));
scrPane.setPreferredSize(new Dimension(500, 710));
scrPane.setMaximumSize(new Dimension(1600, 1600));
scrPane.setBorder(BorderFactory.createLineBorder (Color.white, 3));
jsArea.setContentType("text/javascript");
jsArea.setFont(Font.getFont("Arial"));
content.add(scrPane, c);
The editor works as expected, except when i type something like the following:
ctx.arc(1,2,3,4,5,6)
What happens here is the cursor (believing it is at the end of the line) hovers over “5” and movement of the cursor isn’t consistant with the text being displayed. It works fine on the default font, but I need to use Arial.
**Note I’m using a syntax highlighter, too, which could be the problem.
Any help would be much appreciated.
text/htmlortext/plainortext/rtf, notsetContentType("text/javascript");(usage forJSONorServlet)HTML in Javais reduced for supportHTML<=3.2(partially supporting css & styles)EDIT
HightLighter