wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Problem with Jtable Horizantal Scroll Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with Jtable Horizantal Scroll Pane" Watch "Problem with Jtable Horizantal Scroll Pane" New topic
Author

Problem with Jtable Horizantal Scroll Pane

Brant Thomas
Greenhorn

Joined: Dec 14, 2010
Posts: 2
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

Joined: Jun 13, 2009
Posts: 2153
    
    7
Never set the preferred size of the component being added to the scrollpane. Instead try somthing like:

Mohit J Kumar
Greenhorn

Joined: Apr 08, 2010
Posts: 28

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.

"It's good to B in touch...So keep responding"
Brant Thomas
Greenhorn

Joined: Dec 14, 2010
Posts: 2
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

Joined: Jun 13, 2009
Posts: 2153
    
    7
How can I achieve that now?


I gave you the working code!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38031
    
  22
And welcome to the Ranch Brant Thomas
 
wood burning stoves
 
subject: Problem with Jtable Horizantal Scroll Pane
 
Similar Threads
Jtable retreiving data
JTable
JScrollPane within JTable cell issue
Scrollbar for jtable
JTable