How do I control the size of my JTable column widths?

JTable contains clever (perhaps too clever) logic for allocating column widths when the overall JTable size changes. To explicitly control the size of your individual JTable columns, it is highly advised that you first call table. SetAutoResizeMode(JTable.

AUTO_RESIZE_OFF); Then you will be able to control the size of JTable columns by calling table.getColumnModel(). GetColumn(n). SetPreferredWidth(numPixels); for each column in your table.

See J2PrinterWorksTestApplication. Java for examples. Also, if you have a JTable much larger than a page width and use SHRINK_TO_FIT scaling to fit to one page , you may find that the default font size to be way too small once scaled down.

The easiest way to address this problem is to adjust the sizes of your JTable columns in advance so that the overall JTable size more nearly approximates the printed page. Alternatively, you can increase your font sizes so that they are more in proportion to your JTable size. More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions