Java Reference
In-Depth Information
L ISTING 13.3 Continued
*/
private void showAboutDialog() {
new AboutDialog(this);
}
/**
* insert a new draw into the document
*/
private void addComponent() {
int userSays = JOptionPane.YES_OPTION;
if (!GeneralUtilities.isModuleInstalled(“draw”))
userSays = JOptionPane.showConfirmDialog(this,
“This will install a new Module.
Continue?”,
“Draw Editor Installation”,
JOptionPane.YES_NO_OPTION);
if (userSays==JOptionPane.YES_OPTION) {
textPane.insertComponent(new EmbeddedDraw());
}
}
/**
* inner class for the “show about box” action
*/
public final class About extends AbstractAction {
public About() {
super(“about”);
}
public void actionPerformed(ActionEvent e) {
showAboutDialog();
}
}
/**
* to be launched as a simple application
*/
public static void main(String[] args) {
MainFrame frame = new MainFrame();
}
}
Search WWH ::




Custom Search