これが私のコードです。JTextPane を JScrollPane の中央に配置したいと思います。
JFrame frame = new JFrame("Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JTextPane editor = new JTextPane();
editor.setEditorKit(this);
JScrollPane scroll = new JScrollPane(editor);
//scroll.setAlignmentX(JScrollPane.CENTER_ALIGNMENT); <<<didnt change anything, so //'ed it
frame.getContentPane().add(scroll);
frame.setBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());