AI怎么在JAVA TABLE 中添加 combox (下拉列表)??  
求详解  
谢谢……
tHANK yOU!!

解决方案 »

  1.   

    在java的api文档里有帮助 下面是api的原文:Using a Combo Box as an Editor 
    Setting up a combo box as an editor is simple, as the following example shows. The bold line of code sets up the combo box as the editor for a specific column. 
    //示范在单元格中添加下拉框
    TableColumn sportColumn = table.getColumnModel().getColumn(2);
    ...
    JComboBox comboBox = new JComboBox();
    comboBox.addItem("Snowboarding");
    comboBox.addItem("Rowing");
    comboBox.addItem("Chasing toddlers");
    comboBox.addItem("Speed reading");
    comboBox.addItem("Teaching high school");
    comboBox.addItem("None");
    sportColumn.setCellEditor(new DefaultCellEditor(comboBox));Here is a picture of the combo box editor in use: 
      

  2.   

    对了 忘记告诉你了,如果你用的是jbuilder,只要你前台这么写的话,那么在后台,这个下拉框是会直接生成的,你会看的见,至于事件什么的,直接选中你代码写的下拉框,点击右边的事件就可以直接写代码了。