62,615
社区成员
发帖
与我相关
我的任务
分享
import javax.swing.JFrame;
import javax.swing.JTable;
public class Test extends JFrame
{
public Test(String name)
{
super(name);
}
public static void main(String[] args)
{
Test frame = new Test("Test");
JTable table = new JTable(10,2);
for (int i=0; i<table.getRowCount(); i++)
{
table.setValueAt("hello", i, 0);
}
frame.add(table);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400, 400);
frame.setVisible(true);
}
}