如何在Java swing中使用CellEditor

时间:2016-03-28 04:35:00

标签: java swing tablecelleditor

我将创建JList JPanelJPanel蠕动JtextfieldJLabel,我正在创建此jpanel的列表

public class CasofTablecase extends javax.swing.JPanel {

    /**
     * Creates new form CasofTablecase
     */
    public CasofTablecase() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to                       


    // Variables declaration - do not modify                     
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTextField jTextField1;
    // End of variables declaration                   
}

我正在为我的班级添加DefaultListCellRendererJlist班级):

   public class dlcr extends DefaultListCellRenderer{

        @Override
        public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            return (new CasofTablecase());
        }



    }

我的问题是,如果我点击Jtextfield来写一些内容,但有些事情没有发生,那么如何使用CellEditor

0 个答案:

没有答案