[英]How to set JScrollPane Layout to be the same as JTable?
Tabel1.setModel(new DefaultTableModel(x,y));
JScrollPane pane = new JScrollPane(Tabel1);
When I run the program the scrollpane appears bigger than the table. 当我运行程序时,滚动窗格看起来比表格大。 How can I make the scrollpane layout the same as the table? 如何使滚动窗格的布局与表格相同?
how i can make scrollpane layout the same of table??
if your JTable
contains only a few rows 如果您的JTable
仅包含几行
table.setPreferredScrollableViewportSize(table.getPreferredSize());
Tabel1.setModel(new DefaultTableModel(x,y));
use Java Naming Conventions correctly, then not Tabel1
but tabel1
正确使用Java命名约定 ,然后不是Tabel1
而是tabel1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.