Java Dice Roller with GUI
Rather than swapping out the entire JFrame for another on the button click, you should simply be updating the contents.  This is all very overwrought.  I think all you really need is a panel with a button and a label.  Click the button, and display the results in the label.
Related to the above, rather than overriding paint, you should be using a layout and adding subcomponents.


To get you started:

public class DicePanel extends JPanel {
  private final Dice dice;

  private JButton rollButton;
  private JLabel displayLabel;

  public DicePanel(Dice dice) {
    this.dice = dice;

    rollButton = new JButton("Roll");
    displayLabel = new JLabel();

    rollButton.addActionListener(e -&gt;
      displayLabel.setText("You rolled a: " + dice.roll())
    );
    // or if you're not using Java 8, you can do the more verbose thing.

    // not specifying a layout defaults to a flow layout.  Set a layout via:
    // setLayout(new BorderLayout()); // or whatever
    add(rollButton);
    add(displayLabel);
  }
}


Your program should just create a Dice, create a DicePanel with that, and stick it in a JFrame and show it.  Then play around with layouts to get something you like.