0

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

Community
  • 1
  • 1
Andrea Grimandi
  • 631
  • 2
  • 8
  • 32
  • is about conflict with setXxxSize and in LayoutManager APIs implemented getXxxSize – mKorbel Jun 04 '15 at 12:19
  • but- if I overload the table in order to exceed the panel height it never shows the side scroll bar. == for better help sooner post an SSCCE/MCVE, short, runnable, compilable, with hardcoded value for JTable/XxxTableModel in local variable – mKorbel Jun 04 '15 at 12:20

1 Answers1

1

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

  • Thank you Naren for your suggestion. I've just figured out how to deal with it. I simply had to modify parameters on setBounds() one level above. I couldn't imagine that would have been as easy as is. – Andrea Grimandi Jun 04 '15 at 14:46