Java Code:
public class JTableDeletingSelectedColumns extends JFrame {

    private JTable table;
    private JPanel panel;
    private JScrollPane scroll;
    private JButton deleteColumnButton;
    private DefaultTableModel model;
    
    public JTableDeletingSelectedColumns() {

        initializeInventory();
    }

    private void initializeInventory() {

        panel = new JPanel();
        
        deleteColumnButton = new JButton("Delete");

        panel.setLayout(null);

        final String[] columnNames = {"Name", "Surname", "Age"};

        final Object[][] data = {{"Jhon", "Java", "23"}, {"Stupid", "Stupido", "500"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Michael", "Winnie", "20"}, {"Winnie", "Thepoor", "23"},
                                {"Max", "Dumbass", "10"}, {"Melanie", "Martin", "500"},
                                {"Jollibe", "Mcdonalds", "15"}};

        model = new DefaultTableModel(data, columnNames);

        table = new JTable(model);
        table.setRowSelectionAllowed(true);

        scroll = new JScrollPane(table);
        scroll.setBounds(0, 100, 900, 500);

        deleteColumnButton.setBounds(50, 50, 150, 20);
        deleteColumnButton.addActionListener(new DeleteActionListener());

        panel.add(deleteColumnButton);
        panel.add(scroll);

        getContentPane().add(panel);

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Inventory Window");
        setSize(900, 900);
        setLocationRelativeTo(null);
        setVisible(true);
    }

    private class DeleteActionListener implements ActionListener {

        public void actionPerformed(ActionEvent e) {

            if (deleteColumnButton.equals(e.getSource())) {

                String columnName = JOptionPane.showInputDialog(null, "Please Enter The Column That Will Be Deleted.");
                
                int columnIndex = 0;

                for (int x = 0; x < table.getColumnCount(); x++) {

                    if (columnName.equals(table.getColumnName(x))) {

                        columnIndex = x;
                        table.removeColumn(table.getColumnModel().getColumn(columnIndex));
                    }
                }
            }
        }
    }

    public static void main(String[] args) {

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {

                new JTableDeletingSelectedColumns();
            }
        });
    }
}
I've been searching at google, but I cant find any resources that can resolve this one. I can only delete the column, but I dont know what will happen on its data, then I saw this - Removing a Column from a JTable Component | Example Depot, I found out that the data in the column still lying on its model, so I need to delete it too..

but I cant compile that code properly , now Im getting frustrated how to delete the value in my column model.. help please..