I am trying to add a JTable to a JScrollPane. But I can't see the Table after doing this.
scrollpane.setBounds(100,50,800,400);
JTable table = new JTable(myTableModel(res));
scrollpane.add(table);
What's wrong with me?
I am trying to add a JTable to a JScrollPane. But I can't see the Table after doing this.
scrollpane.setBounds(100,50,800,400);
JTable table = new JTable(myTableModel(res));
scrollpane.add(table);
What's wrong with me?
scrollpane.add(table);
Try this:
JTable table = new JTable(myTableModel(res));
JScrollPane scrollpane = new JScrollPane(table);
scrollpane.setBounds(100,50,800,400);
Try this
scrollpane.setBounds(100,50,800,400);
JTable table = new JTable(myTableModel(res));
scrollpane.setViewporView(table);