java.lang.ArrayIndexOutOfBoundsException: 0 >= 0 attempting to populate JTable

前端 未结 10 1603
猫巷女王i
猫巷女王i 2020-12-20 13:37

I\'m subclassing JTable and using a DefaultTableModel to model my table data. The following class sets up the JTable, and adds one row to the model.

import          


        
10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-20 14:26

    replace

    tabWindow.addTab(...);
    

    with

    SwingUtilities.invokeLater(new Runnable() {
        @Override public void run() {
            tabWindow.addTab(...);
        }
    });
    

    Such situation can hapen when you change tabbed pane in action listener.

提交回复
热议问题