Note that there are some explanatory texts on larger screens.

plurals
  1. POJava adding to table data issue
    primarykey
    data
    text
    <p>Can someone tell me, where is my mistake? I'm trying to fill up table with data but I can't, always get empty table. Here is my code with frame:</p> <pre><code>import java.util.*; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; public class Rinktis extends JFrame { private final JScrollPane scrollPane = new JScrollPane(); private JTable table; public Rinktis() { super(); setBounds(100, 100, 861, 375); try { jbInit(); } catch (Throwable e) { e.printStackTrace(); } } Vector&lt;Vector&lt;String&gt;&gt; data1 =new Vector&lt;Vector&lt;String&gt;&gt;(); Vector&lt;String&gt; heading1 = new Vector&lt;String&gt;(); public void tab(Vector heading, Vector data) { System.out.println(data); System.out.println(heading); data1=data; heading1=heading; System.out.println(data1); System.out.println(heading1); } private void jbInit() throws Exception { getContentPane().setLayout(null); getContentPane().add(scrollPane); scrollPane.setBounds(10, 10, 825, 176); table = new JTable(data1,heading1); scrollPane.setViewportView(table); } } </code></pre> <p>Here's how I call it from another frame:</p> <pre><code> protected void rinktisButton_1_actionPerformed(ActionEvent e) { Rinktis frame = new Rinktis(); frame.setVisible(true); try { db.getClients(); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } </code></pre> <p>and from <code>db.getClients();</code> I call <code>rinktis.tab(columnHeads,v);</code> <code>System.out.println</code> gives me all data correctly, but table is empty.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload