ARTICLE AD BOX
Read the fine manual.
Specifically, read the Javadoc for the class JOptionPane. Copy-paste the fully-qualified name for that class. Paste name into your import statement. Re-compile. import javax.swing.JOptionPane;Read Java Tutorials by Oracle, free of charge. See simple example Swing app with an import line.
Your IDE should be helping you with this, automatically generating the import statements.
Swing has been built into every version of Java since December 8, 1998. So there is no way that JOptionPane is actually missing.
