Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jtable in JScrollPane wont fill the space in the JPanel  RSS feed

 
Wim Van Geyt
Greenhorn
Posts: 27
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
[Thumbnail for JTableWontFillTheSpace.jpg]
The table or ScrollPane wont fill the whole space
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Wim Van Geyt
Greenhorn
Posts: 27
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

that's indeed what i wanted.

So i took your advice and it works.

Thanks a lot.

Greets
Wim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!