日期:2014-05-20  浏览次数:20586 次

Jtalbe疑惑
我想在jtable列出的表格中更改某个单元格的内容,然后在下次重新加载时就变成新内容,该怎么做?
import   java.awt.*;
import   javax.swing.JButton;
import   javax.swing.*;
import   java.awt.event.*;
public   class   JtableDemo   extends   JApplet
{
            JTable   jt;
           
            String[]   tableHead={ "姓名 ", "电话 ", "年龄 "};
           
            public   void   init()
            {
                        Container   cp=getContentPane();
                        cp.setLayout(new   BorderLayout());
                        JButton   jb1=new   JButton( "change ");
                        final   Object[][]   recorder={
                                    { "张三 ", "139367 ", "30 "},
                                    { "李四 ", "139459 ", "30 "},
                                    { "王五 ", "601223 ", "6 "},
                                    { "王六 ", "6271444 ", "6 "}};
                          jt=new   JTable(recorder,tableHead);                          
                          jt.setGridColor(Color.red);
                         
                          int   v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
                          int   h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;                          
                        JScrollPane   jsp=new   JScrollPane(jt,v,h);
                       
                        cp.add(jsp,BorderLayout.CENTER);
                        cp.add(jb1,BorderLayout.SOUTH);
                       
                        jb1.addActionListener(new   ActionListener()
                        {
                                    public   void   actionPerformed(ActionEvent   ae)