嘿,我需要你的幫助code below。我使用NetBeans,我有一個用戶界面,我需要更新一個現有的滾動表與我動態創建的表,但我無法找到任何方式來做這最後3天,你能幫我在這一點?java運行表格表更新問題表格應用程序
dbcon.Connect();
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
Object[][] data = {
{"Kathy", "Smith",
"Snowboarding", new Integer(5), new Boolean(false)},
{"John", "Doe",
"Rowing", new Integer(3), new Boolean(true)},
{"Sue", "Black",
"Knitting", new Integer(2), new Boolean(false)},
{"Jane", "White",
"Speed reading", new Integer(20), new Boolean(true)},
{"Joe", "Brown",
"Pool", new Integer(10), new Boolean(false)}};
DefaultTableModel dtm = new DefaultTableModel(data,columnNames);
JTable table = new JTable(dtm);
// i created this table and can't update an existing Jscrollpane :(
正是我需要一種方法來填充重繪新表到現有的滾動窗格
任何想法的表?
的[示例](http://download.oracle.com/javase/tutorial/uiswing/examples/components/SimpleTableDemoProject/src/components/ SimpleTableDemo.java)從其中(大部分)被複制工作正常。如果這是一個真正的問題,請澄清。 – trashgod 2011-05-07 17:43:53