JTable不能正确显示标题.docVIP

  • 19
  • 0
  • 约2.59万字
  • 约 32页
  • 2016-08-15 发布于安徽
  • 举报
JTable不能正确显示标题.doc

? JTable 不能正确显示标题,关于这个,官方文档里面有说: JTable组件显示数据时,如果直接将其放置在Frame的contentPane中则表头一行会显示不出来,如果将其放置在JScrollPane中显示数据的话,表头会自动显示出来。 引用Sun的原话为: Its easy to put a table in a scroll pane. You need just one or two lines of code: JScrollPane scrollPane = new JScrollPane(table); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); The scroll pane automatically gets the tables header, which displays the column names, and puts it on top of the table. Even when the user scrolls down, the column names remain visible at the top of the viewing area. The scroll pane also tries to make its viewing are

文档评论(0)

1亿VIP精品文档

相关文档