/** @return boolean 判断信息是否填写完整 */ private boolean isComplete() { if (!textID.getText().equals("") && !textLocation.getText().equals("")) { return true; } else { return false; } }
private void setTestState(boolean state) { textID.setEditable(state); textLocation.setEditable(state); OK.setEnabled(state); cancel.setEnabled(state); }
private void initComponents() { int change = 30; title.setBounds(449, 27, 148, 39); title.setFont(fnt1); labelID.setBounds(100, 180 - change, 131, 30); textID.setBounds(206, 184 - change, 144, 24); labelLocation.setBounds(86, 300 - change, 131, 30); textLocation.setBounds(206, 303 - change, 144, 24); labelID.setFont(fnt); labelLocation.setFont(fnt); userId.setLocation(389, 62); userId.setSize(180, 25); userRole.setLocation(514, 62); userRole.setSize(180, 25); OK.setBounds(86, 533 - change, 120, 40); cancel.setBounds(230, 533 - change, 120, 40); butOut.setBounds(52, 36, 120, 40); butAdd.setBounds(114, 632 - change, 120, 40); butDel.setBounds(336, 632 - change, 120, 40); butFind.setBounds(557, 632 - change, 120, 40); butChange.setBounds(779, 632 - change, 120, 40); this.add(title); this.add(labelID); this.add(textID); this.add(labelLocation); this.add(textLocation); this.add(OK); this.add(cancel); this.add(butOut); this.add(butAdd); this.add(butDel); this.add(butFind); this.add(butChange); this.add(userId); this.add(userRole); String[] columnNames = {"机构编号", "机构所处城市"}; int[] list = {40, 272, 14, 30, 20, 384, 126 - change, 561, 465}; // list里面参数分别为需要的列数,每一列的宽度,设置第一行字体大小,设置第一行行宽, // * 剩下行的行宽,表格setbounds(list[5],list[6], list[7], list[8]) // * table = new Table(); add(table.drawTable(columnNames, list)); InformationFind findInfo = new InformationFind(); ArrayList<InstitutionVO> ins = findInfo.findInstitution(); for (int i = 0; i < ins.size(); i++) { table.setValueAt(i, 1, ins.get(i).getLocation()); table.setValueAt(i, 0, ins.get(i).getID()); } }
private void empty() { textID.setText(null); textLocation.setText(null); }