gre*_*rep 3 java swing jscrollpane
我JTable
在JScrollPane
.
JTable table = new JTable(data, columnNames);
JScrollPane scroll = new JScrollPane();
scroll.setViewportView(table);
Run Code Online (Sandbox Code Playgroud)
一切都很好,但是如果我需要在 Scrollpanel 和 table 之间留出更多空间?我怎样才能做到这一点?例如:HTML/CSS
如果我们使用<div>
标签,我们有“填充”方法。我需要这样的东西。
你可以做
scroll.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1516 次 |
最近记录: |