How to display a JTable in a JPanel with Java?

前端 未结 2 2047
野性不改
野性不改 2020-12-17 01:50

How to display a JTable in a JPanel with Java?

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 02:25

    JTable table = new JTable();
    JScrollPane spTable = new JScrollPane(table);
    JPanel panel = new JPanel();
    
    panel.add(spTable);
    

    There is a comphrensive guide about how to layout swing components, you should consider Pyrolistical link..

提交回复
热议问题