user1980875
user1980875

Reputation:

How do you set the column width of a Scala Swing Table

In Java, you can set the preferred column width of a JTable using the getColumnModel method, but in scala swing you can't do that. So is there a way to set the column width of a Scala Swing Table?

Upvotes: 2

Views: 381

Answers (1)

Kigyo
Kigyo

Reputation: 5768

Most scala.swing components just "wrap" Java-Components. All Methods from the Java-Component can be accessed via the peer.

(new Table).peer.getColumnModel.getColumn(0).setPreferredWidth(0)

Upvotes: 3

Related Questions