My JTable is getting too big where I have all eight columns to display , May I add an horizontal or vertical scroll bar to my JTable?
May I explain to you my situation so your may have a better understanding of my situation.
I have a Jframe . In the Jframe, I create a North Panel, a West Panel, and a South Panel for display different kind of data.
In my West Panel, I have a GridBagConstraint called tableGC as in the code below. TableGC have two rows. The first row contains my table, and the
second row contain the submit button.
My question is that could I make my table scroll-able on both horizontal and vertical direction . I was googling and someone told me that I need
to create a JScrolPanel and instantiated it with my Jtable and, add the new tableScrollPanel to my westPanel as my gridbaglayout element.
I followed them and did what I was taught as followed in the following code
But it did not work, it only showed me a very little bit tiny table on my westPanel.
So I would like to seek your help and expertise on how should I make my table scroll-able and my table is in the first row of a gridbaglayout , and the
gridbaglayout is in the westPanel?
Many Thanks for all of your helps!!