Я много гуглил, но ничего не нашел по этой теме.
Вот мой код:< /p>
hebrewField = new JTextPane();
hebrewField.setFont(ApplicationFonts.getHebrewFont(30F));
hebrewField.setDocument(new NikudStyledDocument(true));
hebrewField.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
hebrewField.setMinimumSize(new Dimension(Settings.getKeyboardWidth() - 30,
(heightTotal - heightBorderTitel)));
hebrewField.setMaximumSize(
new Dimension(this.widthTotal, (heightTotal - heightBorderTitel)));
hebrewField.setBorder(
BorderFactory.createTitledBorder(translator.realisticTranslate(
Translation.HEBRAEISCH__EINFACHE_SCHREIBWEISE)));
changeLineSpacing(hebrewField);
и
private void changeLineSpacing(JTextPane pane) {
SimpleAttributeSet set = new SimpleAttributeSet(pane.getParagraphAttributes());
StyleConstants.setLineSpacing(set, 0.5F);
pane.setParagraphAttributes(set, true);
}
Кто-нибудь еще помнит, как это сделать в Java Swing? Любые идеи приветствуются. Спасибо за вашу доброту.

ОБНОВЛЕНИЕ
Здесь текст задан. Думаю, мне нужно установить позицию курсора после вставки текста.
public void mousePressed(MouseEvent e)
{
DataButton jButton = (DataButton) e.getComponent();
String caption = jButton.getData();
JTextComponent focusElement = findFocusElement();
if (focusElement != null)
{
int position = focusElement.getCaretPosition();
String text = focusElement.getText();
String before = text.substring(0, position);
String after = text.substring(position);
focusElement.setText(before + caption + after);
focusElement.requestFocus();
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... ce-the-pro