newButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int confirm = JOptionPane.showConfirmDialog(TableEditorFrame.this, "Discard all changes?", "New Table", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (confirm == JOptionPane.YES_OPTION) {
model.clear();
model.insertColumn("New Column", 0);
model.insertRow(0);
}
}
});