CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - ScrollPane
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - ScrollPane - List
[
JSP/Java
]
Jtable
DL : 0
While dealing with JTable you come across two main features 1)JTable 2)TableModel With JTable you can display the data. You can allow the user to edit the data. The tableModel takes care of the data to be displayed using JTable. The JTable is normally added in <I>JScrollPane</I>. So when the rows get exceeded display area, the scrollbars of the scrollpane automatically gets activated. you have to import javax.swing.table.* See Below Code in which there are 4 JButtons 1)Add Row 2)Delete Row 3)GetValue 4)SetValue Using those buttons you can create a row,delete a row at runtime. getValue returns value at particular cell while setValue sets the value at particular cell plus other important JTable related methods are discussed below. see the code below (tableExample.java).
Date
: 2025-07-01
Size
: 2kb
User
:
Ryo
[
Internet-Network
]
jquery-scrollpane-master
DL : 0
替代系统滚动条,通过代码替代系统的滚动条. 替代系统滚动条,通过代码替代系统的滚动条.-Alternative systems scroll bars, alternative systems through code scroll bar scroll bar alternative systems, alternative systems through code scroll bar.
Date
: 2025-07-01
Size
: 77kb
User
:
吴
[
FlashMX
]
JXCManager0309
DL : 0
设计使用 JTable 的应用程序时,务必要注意用来表示表数据的数据结构。DefaultTableModel 是一个模型实现,它使用一个 Vector 来存储所有单元格的值,该 Vector 由包含多个 Object 的 Vector 组成。除了将数据从应用程序复制到 DefaultTableModel 中之外,还可以用 TableModel 接口的方法来包装数据,这样可将数据直接传递到 JTable,如上例所示。这通常可以提高应用程序的效率,因为模型可以自由选择最适合数据的内部表示形式。在决定使用 AbstractTableModel 还是使用 DefaultTableModel 方面有一个好的实践经验,即在创建子类时使用 AbstractTableModel 作为基类,在不需要创建子类时则使用 DefaultTableModel。 -main TableModel dataModel = new AbstractTableModel() { public int getColumnCount() { return 10 } public int getRowCount() { return 10 } public Object getValueAt(int row, int col) { return new Integer(row*col) } } JTable table = new JTable(dataModel) JScrollPane scrollpane = new JScrollPane(table)
Date
: 2025-07-01
Size
: 1.98mb
User
:
秋玉珑
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.