I have a public Collection<Suppliers> getAllSuppliers()
method which obviously returns the data from the suppliers
table.
In the client part swing
I try to show in a JFrame
an object JTable
containing the records of the table.
Runnable runner = new Runnable()
{
@Override
public void run()
{
Facade facade = new Facade();
Collection<Suppliers> suppliers = facade.getAllSuppliers();
JFrame frame = new JFrame("JTable Data");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300, 600);
Container content = frame.getContentPane();
content.setLayout(new BorderLayout());
frame.setVisible(true);
}
};
EventQueue.invokeLater(runner);
I'm starting on the theme of applications swing the model MVC
, I'm trying to pass the object suppliers
which contains a collection of suppliers
to DefaultTableModel
but without success. Do I have to change the interface Collection
?
Thanks for your time