JTable Can Now Fill the Viewport

A long time frustration for Swing users has been the inability for JTable to fill the viewport of its enclosing scroll pane. There are work arounds but they are annoying (for instance you need to subclass JTable). Shannon Hickey, member of the Swing Team, posted a new blog entry in his series about drag and drop enhancements in Mustang. This entry deals with tables and you will learn that Java SE 6 provides a method to force a JTable to fill its enclosing viewport. Best of all, it is as easy as calling setFillsViewportHeight(true). Mustang rocks :)

Comments are closed.