I want to create a pop up box that is activated when I click a “Check” button. What it does is ask the user if they are sure about what they requested. If yes, it does the request. If no, it goes back to it’s normal state.
I know what I said is a bit ambiguous but I want to create various types of pop up boxes.
So I was wondering is there a website that has generic pop up boxes with the code given?
I just need a simple code which I can expand on.
I think JOptionPane is what you want.
showConfirmDialog: Asks a confirmingquestion, like yes/no/cancel.
showInputDialog: Prompt for someinput.
showMessageDialog: Tell theuser about something that has
happened.
showOptionDialog: The GrandUnification of the above three.
A small example to get a Yes-No popup like you asked for would be:
This solution, however, only works if you are using Swing.