title: How to make repaint for JDialog in Swing?
body: <p>How to make repaint for JDialog in Swing?
  If I click on convert button in JDialog I need to change GUI design of JDialog but it's not happening? Is their any solution?</p>
  
  <pre><code>    _convertAction = new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
              String para = new String(); 
              _task.setBookTypeId(13);
               initComponents();
             //   validate();
             //   repaint();
              setVisible(true);
          }
        };
  </code></pre>
  
  <p>I'm setting booking type id is 13 .</p>
  
  <pre><code>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);
  }
  </code></pre>
  
  <p>Using Id I'm changing componenents in initcomponents method.</p>