import javax.swing.*;
public class MainP2 {
public MainP2() {
JOptionPane.showMessageDialog(
null,
"Hi welcome to my square Pyramid calculator." + "\nPress Ok to begin.",
"CIS 2235",
JOptionPane.PLAIN_MESSAGE
);
String[] possibilities = {
"adjust height",
"adjust baselength",
"adjust height and baselength",
"exit"
};
String s = (String)JOptionPane.showInputDialog(
null,
"Choose one",
"Customized Dialog",
JOptionPane.PLAIN_MESSAGE,
null,
possibilities,
possibilities[0]
);
//-----here's the problem with the code, am i calling it wrong?
if(possibilities.equals(possibilities[0])){
String myString = JOptionPane.showInputDialog(null,"Please enter height: ");
}
}
public static void main …
Run Code Online (Sandbox Code Playgroud)