这里面包含了一百多个JAVA源文件

源代码在线查看: e931. showing the table header in a non-scrollable jtable component.txt

软件大小: 551 K
上传用户: maple_78
关键词: JAVA
下载地址: 免注册下载 普通下载 VIP

相关代码

				By default, if you don't place a table component in a scroll pane, the table header is not shown. You need to explicitly display it. 
				    int rows = 10;
				    int cols = 5;
				    JTable table = new JTable(rows, cols);
				    JTableHeader header = table.getTableHeader();
				    
				    container.setLayout(new BorderLayout());
				    
				    // Add header in NORTH slot
				    container.add(header, BorderLayout.NORTH);
				    
				    // Add table itself to CENTER slot
				    container.add(table, BorderLayout.CENTER);
				
							

相关资源