示例#1
0
  /** Displays the calculator GUI with the given amount of inputs (1 or 2). */
  public void showCalculator(int operator, int numOfInputs) {
    if (animate) {
      if (numOfInputs == 2) gui.showLeftInput();
      else gui.hideLeftInput();

      gui.reset();
      gui.setOperator(operators[operator]);
      gui.showCalculator();
    }
  }
示例#2
0
  /**
   * ************************************************************************ * MAIN METHOD * *
   * ***********************************************************************
   */
  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception e) {
      System.out.println("Unable to load Windows look and feel");
    }

    CalculatorGUI frame = new CalculatorGUI();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
  }
示例#3
0
 /** Hides the calculator GUI. */
 public void hideCalculator() {
   if (animate) gui.hideCalculator();
 }