I would like to implement a mechanism in my program which will auto rescale JScrollPane when columns are to long to be fully seen in the JScrollpane's viewport:
For example my JTable look like:
___________ JScrollPanel _____________
| |
| __________ JTable _______________|_ ___
| |________|______|______|_____|____|_|___|
| | | | | | | | |
| |________|______|______|_____|____|_|___|
|______________________________________|
Now how to set to auto rescal JscrollPanel toward wider JTable
___________ JScrollPanel ______________________
| <------>|
| __________ JTable _________________ ___ |
| |________|______|______|_____|____|_|___| |
| | | | | | | | | |
| |________|______|______|_____|____|_|___| |
| <------->|
|______________________________________________|
Sometimes i get data from JTableModel and i dont know how long data will be i JTable headers.