This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

viewing large Jtable

 
Daniel Roach
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a large Jtable (300 columns), how do I obtain a scrollbar so I can view columns which do not fit onto the JScrollpane?
Thanks
 
Jagan Mohan Reddy
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Think the below sample code might solve ur problem..
table = new JTable(3,300);
table.setAutoResizeMode(table.AUTO_RESIZE_OFF); // Used to set the Auto resize in the off mode..
scrollPane = new JScrollPane(table);
table.setPreferredScrollableViewportSize(new Dimension(50,50));
getContentPane().add(scrollPane);
Regards,
Jagan Mohan Reddy
 
Daniel Roach
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jagan Mohan Reddy:
Hi,
Think the below sample code might solve ur problem..
table = new JTable(3,300);
table.setAutoResizeMode(table.AUTO_RESIZE_OFF); // Used to set the Auto resize in the off mode..
scrollPane = new JScrollPane(table);
table.setPreferredScrollableViewportSize(new Dimension(50,50));
getContentPane().add(scrollPane);
Regards,
Jagan Mohan Reddy
 
Daniel Roach
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jagan it worked perfectly
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic