0

Hi,

I have 1 jframe containing 1 panel. This panel shows data using JTable. I want to put button at the bottom of the panel to print that data in PDF. Can I reduce the size of the JTable? Currently it takes the size as that of the panel.

Thanks

3
Contributors
3
Replies
4
Views
4 Years
Discussion Span
Last Post by mKorbel
0

Can I reduce the size of the JTable? Currently it takes the size as that of the panel.

no idea about numbers of records. but

1) myJTable.setPreferredScrollableViewportSize(myJTable.getPreferredSize()), for a few row, this should to reduce the size of JScrollPane

2) have to get height from row (Assume that every rows have got the same size) and multiply with desired number of row, this Dimmension put to the code line in 1st. point, instead of myJTable.getPreferredSize()

0

use layout to restrict objects to place and area you want.
As i can see, your JTable need a size set also.

0
  • use layout to restrict objects to place and area you want.

simply not

  • As i can see, your JTable need a size set also.

never ever to set for JComponents Size that are inside JScrollPane, any reason for, everything is implemented in the API and correctly, simply not

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.