스윙에서 JDialog를 다시 그리는 방법? JDialog의 변환 버튼을 클릭하면 JDialog의 GUI 디자인을 변경해야하지만 실제로 발생하지는 않습니까? 그들의 모든 해결책이 있습니까?스윙에서 JDialog를 다시 그리는 방법?
_convertAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
String para = new String();
_task.setBookTypeId(13);
initComponents();
// validate();
// repaint();
setVisible(true);
}
};
예약 유형 ID는 13입니다.
if(_task.getBookTypeId()== 1){
String colnames[] = {"Leg","Departure", "Date","Time", "Arrival","Date", "Time","How","Aircraft","PIC","Copilot"};
MyTableModel mytablemodel = new MyTableModel(colnames);
legdetailsTable = new JTable(mytablemodel);
legdetailsTable.setRowSelectionAllowed(true);
}else {
System.out.println("Brokered booking table");
String colnames[] = {"Leg","Departure", "Date","Time", "Arrival","Date", "Time","How"};
MyTableModel mytablemodel = new MyTableModel(colnames);
legdetailsTable = new JTable(mytablemodel);
legdetailsTable.setRowSelectionAllowed(true);
}
이드를 사용하여 initcomponents 메소드에서 구성 요소를 변경하고 있습니다.
@Jonas 만약 OP를 게시 [SSCCE] (http://pscode.org/sscce.html), 관련 코드가 있음을 보증합니다. 그러나 문제가 해결 될 때까지 대부분의 사람들은 관련 코드가 무엇인지 모릅니다. * –