AI怎么在JAVA TABLE 中添加 combox (下拉列表)??
求详解
谢谢……
tHANK yOU!!
求详解
谢谢……
tHANK yOU!!
解决方案 »
- 关于SocketChannel.write的一些问题
- count(*)与count(emp_no)差别很大不?
- SocketException的问题
- 谁来帮我讲解一下这道题~~~谢谢
- 关于PushbackInputStream()问题,程序结果感到疑惑
- 那位高手帮忙看看这几道题的答案
- 请高手指点:关于数据的表示问题
- 为什么我用httpclient的时候,经常出现ProtocolException,Connection ,IOException错误!!!
- int型(or short)怎样转换为byte[]型啊?新手求救
- 关于Apache SOAP 的问题
- static{} 的问题
- 给几个简单的iterator方法,以便更好的理解iterator的使用
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: