package holeg.ui; import holeg.GridSolverResult; import javax.swing.*; public class SolveResultMessageBox { public static void show(GridSolverResult result) { switch(result) { case Error: default: JOptionPane.showMessageDialog(null,"Could not solve grid.","Error while solving.", JOptionPane.ERROR_MESSAGE); break; case PartialFailure: JOptionPane.showMessageDialog(null,"Could not solve some part of the grid.","Error while solving.", JOptionPane.ERROR_MESSAGE); break; case Solved: JOptionPane.showMessageDialog(null,"Successfully solved!","Success", JOptionPane.INFORMATION_MESSAGE); break; case Interrupted: JOptionPane.showMessageDialog(null,"Solver interrupted!","Interrupted while solving.", JOptionPane.WARNING_MESSAGE); break; } } }