I have a JDialog class named Preferences. This class creates a constructor like:
class Preferences extends javax.swing.JDialog {
You don't add the JDialog to the JFrame, that makes no sense whatsoever since the add(...) method is for adding components to be displayed in the container, not by the container. You display the JDialog from the JFrame's JButton's ActionListener. You also shouldn't be mixing AWT (Frame) components and Swing components together for no good reason.
Your question suggests that you would benefit greatly by going through the Swing tutorials.