title: java swing jtable add two table from database in single table
body: <p>I have table named  tbl_income and tbl_expenses...
  tbl_income contain four column and four row and tbl_expenses contain four column and three row link in picture below.</p>
  
  <p><a href="https://i.stack.imgur.com/Ff2UY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ff2UY.jpg" alt="enter image description here"></a></p>
  
  <p>I want to mank single table in java swing JTable link picture in below.</p>
  
  <p><a href="https://i.stack.imgur.com/ycIwI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ycIwI.jpg" alt="enter image description here"></a></p>
  
  <p>how can i make like this.... sorry for bad english.. </p>
  
  <p>This is what i've tried:</p>
  
  <pre><code> DefaultTableModel model = (DefaultTableModel) tbldailybook.getModel();
          try {
              Statement stmt = db.cn.createStatement();
              ResultSet rs = stmt.executeQuery("select * from tblincome,tblexpenses");
              while (rs.next()) {
                  model.addRow(new Object[]{rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(6), rs.getString(7), rs.getString(8)});
              }
          } catch (Exception e) {
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/l2FWi.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l2FWi.jpg" alt="enter image description here"></a></p>
  
  <p>tblincome have single row but row reply</p>