Creating GUI in Java java To create form screens in Java, import javax.swing.The JOptionPane; library is used. The following is an example of…