JScrollPane editorScrollPane = new JScrollPane(editorPane,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
editorScrollPane.setPreferredSize(new Dimension(250, 145));
editorScrollPane.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
if ( data.useRtl() ) { editorScrollPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
JViewport port = editorScrollPane.getViewport();
port.getVisibleRect().setLocation(0,0);
if ( data.useRtl() ) { port.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
editorScrollPane.setViewport(port);