実際には可能です、luiscubal。方法は次のとおりです。
JScrollPane に、サイズ変更イベント用の ComponentListener を追加します。
public static void main(String...args) {
    //our test frame
    JFrame frame = new JFrame("JEditorPane inside JScrollPane resizing");
    frame.setLayout(new BorderLayout());
    //our editing pane
    final JEditorPane editor = new JEditorPane();
    //our simple scroll pane
    final JScrollPane scroller = new JScrollPane(editor);
    //NOTE: this is the magic that is kind of a workaround
            // you can also implement your own type of JScrollPane
            // using the JScrollBar and a JViewport which is the 
            // preferred method of doing something like this the 
            // other option is to create a JEditorPane subclass that
            // implements the Scrollable interface.
    scroller.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            editor.setSize(new Dimension(
                               scroller.getWidth()-20, 
                               scroller.getHeight()-20));
        }
    });
    //just use up the entire frame area.
    frame.add(scroller, BorderLayout.CENTER);
    //quick and dirty close event handler
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(320, 240); //something not too big
    frame.setLocationRelativeTo(null); //centers window on screen
    frame.setVisible(true); // normally done in a SwingUtilities.invokeLater
}
それは可能ですluiscubalを見てください。Java では不可能なことをすぐに発表しないでください。swing API は静かで柔軟性があり、多くの作業を行うことができます。ただし、JComponents を使用するために作成されていない方法で使用すると、問題が発生し、2 つの選択肢があります。
- サブクラス サブクラス サブクラス 基本的に独自のコンポーネントを作成します。
- 上記の解決策のような回避策を見つけてください。