This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Jtable Horizantal Scroll Pane

 
Brant Thomas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a Java swing application which has a Jtable inside Jscrollpane. The scrollpane is assed to the JFrame. When I scroll horizontally, The header text is blurred/disappeared. I know the reason is because of having the huge width settings to the table which is greater than frame size. But I need to have that setting. I have attached a sample code to show my issue.

 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never set the preferred size of the component being added to the scrollpane. Instead try somthing like:

 
Mohit J Kumar
Ranch Hand
Posts: 33
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is working just fine on my machine.
It's is not making any difference even after commenting out the size settings.
I am using Eclipse IDE.
 
Brant Thomas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set the preferred size because when I maximize the panel, My table should adjust to the size of the maximized panel. How can I achieve that now?Because, If i remove the preferred size, even If i maximize the size remains the same.
 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I achieve that now?


I gave you the working code!
 
Campbell Ritchie
Sheriff
Pie
Posts: 48940
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch Brant Thomas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic