/** 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(); } }
/** * ************************************************************************ * 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); }
/** Hides the calculator GUI. */ public void hideCalculator() { if (animate) gui.hideCalculator(); }