My situation is: I am trying to find a way to disable and enable the okay and cancel buttons for a JOptionPane based on null and incorrect input conditions. Is this possible and if so can you provide me with some ideas on how to get this done?

Thanks