Apache NetBeans
Apache NetBeans
Latest release

Apache NetBeans 22

Download

How do I add horizontal scrolling support in the OutlineView component?

The OutlineView component already contains a JScrollPane, but the component’s default behavior is to fit all the columns in the available space. If you have a large number of columns, say twenty or more, you may find that the horizontal space allocated to any one column is insufficient. In this case, you will likely want to disable table column resizing so that you can scroll left or right to see the data. This can be accomplished by adding one line of code:

outlineView.getOutline().setAutoResizeMode(JTable.AUTO_RESIZE_OFF);