Forums Register Login

Jtable in JScrollPane wont fill the space in the JPanel

1
+Pie Number of slices to send: Send
Hi everyone,

i have a problem with the size of my scrollPane. It won't fill the space in the JPanel.

is there a way to let the scrollPane fill the whole space?

Kind regards
Wim
JTableWontFillTheSpace.jpg
The table or ScrollPane wont fill the whole space
[Thumbnail for JTableWontFillTheSpace.jpg]
2
+Pie Number of slices to send: Send
Works fine for me using code like:



I'm guessing you are adding the scrollpane to a panel and then adding the panel to the tabbed pane. This won't work because the default layout of a panel is a FlowLayout which respects the preferred size of the components added to it.

Either:

1) get rid of the panel
2) set the layout of the panel to a BorderLayout.

If you need more help (and for future questions) post a proper SSCCE that demonstrates the problem.
1
+Pie Number of slices to send: Send
Hi Rob,

that's indeed what i wanted.

So i took your advice and it works.

Thanks a lot.

Greets
Wim
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3141 times.
Similar Threads
JTable in JScrollPane sizeing
JTable column in the middle is empty?
Swing problem with JTable
empty JTable
Problem with JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:32:44.