Re: Horizontally scrolling JTable
- From: "Andrew Thompson" <andrewthommo@xxxxxxxxx>
- Date: 28 Mar 2007 02:57:03 -0700
On Mar 28, 7:17 pm, RedGrittyBrick <redgrittybr...@xxxxxxxxxxxxx>
wrote:
I am unable to make my JTable/JScrollPane so that it gains horizontal....
scrollbars when container width < JTable min width.
Any suggestions?
SSCCE
-----------------------------------8<---------------------------------
import java.awt.BorderLayout;
public class HorizScrollTable extends JPanel {
HorizScrollTable() {
column.setPreferredWidth(width);
column.setMinWidth(width); // [2]
}
JPanel p = new JPanel(new BorderLayout());
p.add(table, BorderLayout.CENTER); // [3]
// new ..
p.setPreferredSize( table.getPreferredSize() );
JScrollPane scrollPane = new JScrollPane( p );
.....
Andrew T.
.
- Follow-Ups:
- Re: Horizontally scrolling JTable
- From: RedGrittyBrick
- Re: Horizontally scrolling JTable
- References:
- Horizontally scrolling JTable
- From: RedGrittyBrick
- Horizontally scrolling JTable
- Prev by Date: Horizontally scrolling JTable
- Next by Date: Re: Horizontally scrolling JTable
- Previous by thread: Horizontally scrolling JTable
- Next by thread: Re: Horizontally scrolling JTable
- Index(es):
Relevant Pages
|
|