title: Why can't I use DefaultTableModel? Am I missing something Obvious? (Java)
body: <p>Here is my code:</p>
  
  <pre><code>import javax.swing.*; 
  import java.awt.*; 
  import java.awt.event.*;
  
   class Test{ 
          static CardLayout cardLayout;  
          static JPanel card = new JPanel();
  
          public static void main(String[] args) {
              JFrame frame = new JFrame("AddressBook");
              JPanel contentPane = (JPanel)frame.getContentPane();
              card.setLayout(cardLayout = new CardLayout());                          
  
              JPanel cardTop = new JPanel();
              DefaultTableModel model = new DefaultTableModel();
              model.addColumn("Name");
              model.addColumn("Number");
              String[] John = {"John", "1234"};
              model.addRow(John);
              String[] Beth = {"Beth", "4444"};
              model.addRow(John);
              JTable table = new JTable(model);       
              JScrollPane jsp = new JScrollPane(table);
              cardTop.add(jsp);
  
  
              card.add("Card Top", cardTop);
              contentPane.add(card);
  
              frame.setVisible(true);
              frame.setSize(507, 191);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setResizable(false);
          }
      }
  </code></pre>
  
  <p>When I try to compile, it says it doesn't recognize DefaultTableModel. Also, the code above is part of my main and I'm sure I've imported the right libraries.</p>
  
  <p>Here is the error:</p>
  
  <pre><code>Test.java:15: error: cannot find symbol
              DefaultTableModel model = new DefaultTableModel();
              ^
    symbol:   class DefaultTableModel
    location: class Test
  Test.java:15: error: cannot find symbol
              DefaultTableModel model = new DefaultTableModel();
                                            ^
    symbol:   class DefaultTableModel
    location: class Test
  2 errors
  </code></pre>
  
  <p>Help please?</p>