Hello
Mam problem: uzywam JTextPane. Chce aby pierwsza linia była do prawej a druga do lewej.
Mam:
SimpleAttributeSet saRight = new SimpleAttributeSet();
StyleConstants.setAlignment(saRight , StyleConstants.ALIGN_RIGHT);
SimpleAttributeSet saLeft = new SimpleAttributeSet();
StyleConstants.setAlignment(saLeft , StyleConstants.ALIGN_LEFT);
calcPane.getDocument().insertString(0, "first\n", saRight);
calcPane.getDocument().insertString(calcPane.getDocument().getLength(), "second", saLeft);
Nie działa - oby dwa wiersze sa do lewej. jakis pomysł?