Reputation: 3078
I am using a jtable which have 8 rows by default. When I add a new row using a button click a vertical scrollbar comes into picture and covers up my data of last column in jtable which is right aligned. How can I overcome this?
Upvotes: 1
Views: 731
Reputation: 205785
Specify setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS)
on the JScrollPane
. This will leave room for the scroll bar when (if) it becomes necessary.
Upvotes: 2
Reputation: 23629
Sounds like you need to give your table a little bit more space to account for the addition of a scroll bar. You will need to possibly mess with the preferredSize.
Upvotes: 0