How to size a JTable in a JScrollPane without setPreferredSize()

This question already has an answer here:

  • re-size JTable when useing Default table model 2 answers

I have to get smaller a JTable inside a JScrollPanel. I've found this topic which in the first answer is shown how to do that -but- if I overload the table in order to exceed the panel height it never shows the side scroll bar. Also the same problem is mentioned in the topic. Are clear cons of using preferred size but I still haven't figured out what I should do for re-size my Table.

Please, could someone give me a clear explanation?

Thank you,

Andrea

-------------Problems Reply------------

Try Setting setPreferredSize() for the Scroll Pane and add Jtable to the Scroll Pane. Just give a try.

Category:java Views:0 Time:2018-10-11

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.155 (s). 11 q(s)