SolveResultMessageBox.java 750 B

123456789101112131415161718192021
  1. package holeg.ui;
  2. import holeg.GridSolverResult;
  3. import javax.swing.*;
  4. public class SolveResultMessageBox {
  5. public static void show(GridSolverResult result) {
  6. switch(result) {
  7. case Error:
  8. JOptionPane.showMessageDialog(null,"Could not solve grid.","Error while solving.", JOptionPane.ERROR_MESSAGE);
  9. break;
  10. case PartialFailure:
  11. JOptionPane.showMessageDialog(null,"Could not solve some part of the grid.","Error while solving.", JOptionPane.ERROR_MESSAGE);
  12. break;
  13. case Solved:
  14. JOptionPane.showMessageDialog(null,"Successfully solved!","Success", JOptionPane.INFORMATION_MESSAGE);
  15. break;
  16. }
  17. }
  18. }