options = new Object
"No Error", "MyException1", "MyException2";
int selected = JOptionPane.showOptionDialog(
null,
"Please select an Exception to throw!",
"MockingObjectRuntimeConfigurator",
0,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options0 );
switch (selected) {
case 0: //No Error
return;
case 1: //MyException1
throw new MyException1();
case 2: //MyException2
selectedElement.set...(...);
throw new MyException2();
}
}
]]>
|