Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Moving JTable column with mouse does not start horizontal autoscroll

800346Dec 5 2008 — edited Dec 7 2008
While dragging the column header with the mouse,
I try to move column A to the position between columns Y and Z.
When the mouse pointer comes to the right edge of the scrollpane,
I would expect it to start a horizontal autoscroll, but this does not happen.
Is there any way to make it work?
import java.awt.*;
import javax.swing.*;
public class TableDemo extends JFrame{
    private JTable table;
    public TableDemo(){
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(400, 300);
        table = new JTable(4, 26);
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
    }
    public static void main(final String[] args) {
        new TableDemo().setVisible(true);
    }
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2009
Added on Dec 5 2008
6 comments
432 views