protected void addLines() throws BOSException{
if(tabName != null && !tabName.equals("")){
ShipRepairedTypeCollection typeCon =
ShipRepairedTypeFactory.getRemoteInstance().getShipRepairedTypeCollection("where name = '"+tabName+"'");
if (typeCon.size() != 0) {
//获取监听标准产品的分录自带的"增加","删除"按钮的监听
ActionListener[] actionListeners = this.kdtEntrys_detailPanel.getAddNewLineButton().getActionListeners();
actionListeners[0].actionPerformed(null);//获取监听后按钮的功能
kdtEntrys.getRow(kdtEntrys.getRowCount()-1).getCell("projectType").setValue(typeCon.get(0));
}
}
}
本文介绍了一段Java代码,该代码在特定条件下为表格添加一行,并设置该行的projectType单元格的值。代码首先检查变量tabName是否已设置且不为空,然后从数据库中获取对应的ShipRepairedTypeCollection实例。如果查询结果不为空,则通过监听器触发增加按钮的功能,并将查询结果的第一项设置为新增行的projectType单元格的值。
696

被折叠的 条评论
为什么被折叠?



