는 여기가 JScrollPane의에서 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());
JScrollPane의 컴포넌트를 가운데에 배치한다는 것은 무엇을 의미합니까? 귀하의 예제에서'JScrollPane'은'JFrame'의 contentPane을 채우기 위해 늘어나고'JTextPane'은'JScrollPane'을 채우기 위해 늘어납니다. 나는 그 맥락에서 "중심"이 무슨 뜻인지 이해할 수 없다. – Xeon