本文整理汇总了Java中javax.swing.JOptionPane.showInternalMessageDialog方法的典型用法代码示例。如果您正苦于以下问题:Java JOptionPane.showInternalMessageDialog方法的具体用法?Java JOptionPane.showInternalMessageDialog怎么用?Java JOptionPane.showInternalMessageDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JOptionPane
的用法示例。
在下文中一共展示了JOptionPane.showInternalMessageDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OntologyClassTree
import javax.swing.JOptionPane; //导入方法依赖的package包/类
/**
* Constructor of this class
* @param root The root node where further nodes can be added
* @param ontoClass The current instance of OntologyClass
* @param ontologieSourcePackage The reference to the package of the ontology
*/
public OntologyClassTree(DefaultMutableTreeNode root, OntologyClass ontoClass, String ontologieSourcePackage) {
super(root);
this.currOntoClass = ontoClass;
this.searchInPackage = ontologieSourcePackage;
this.rootNode = root;
// --- Add the default nodes for an ontology ----------
this.addDefaultNodes();
// --- Add the nodes from the given ontology -----------
this.addOntologyNodes();
// --- Did we had an error here? -----------------------
if (logMsgShow==true ) {
// --- If an error occurs, show the message --------
String MsgHead = OntologyVisualisationConfiguration.getApplicationTitle() + ": " + logMsgTitleOnto;
String MsgText = ontologieSourcePackage + ":\n" + logMsgOnto;
// --- Send Message to user of AgentGUI ------------
JOptionPane.showInternalMessageDialog(OntologyVisualisationConfiguration.getOwnerWindow(), MsgText, MsgHead, JOptionPane.ERROR_MESSAGE);
// --- Add the Error to the current ontology class -
currOntoClass.ontologyErrorStack += MsgText;
}
}
示例2: actionPerformed
import javax.swing.JOptionPane; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent ae) {
String actCMD = ae.getActionCommand();
String msgHead = null;
String msgText = null;
if (actCMD.equals("OntologieAdd")) {
// --- Add Ontology -------------------------------------
String ActionTitel = Language.translate("Ontologie hinzufügen");
OntologieSelector onSel = new OntologieSelector(Application.getMainWindow(), currProject.getProjectName() + ": " + ActionTitel, true);
onSel.setVisible(true);
// === Wait for user ===
if (onSel.isCanceled()==true) {
Application.setStatusBar(Language.translate("Fertig"));
return;
}
String newOntologie = onSel.getNewOntologySelected();
onSel.dispose();
onSel = null;
// --- Add ontology -------------------------------------
currProject.subOntologyAdd(newOntologie);
} else if (actCMD.equals("OntologieRemove")) {
// --- Remove Ontology ----------------------------------
if (ontoTree.isSelectionEmpty()) {
msgHead = Language.translate("Fehlende Auswahl !");
msgText = Language.translate("Zum Löschen, wählen Sie bitte eine der dargestellten Ontologien aus!");
JOptionPane.showInternalMessageDialog( Application.getMainWindow().getContentPane(), msgText, msgHead, JOptionPane.INFORMATION_MESSAGE);
return;
}
DefaultMutableTreeNode currNode = (DefaultMutableTreeNode) ontoTree.getSelectionPath().getLastPathComponent();
OntologyClassTreeObject octo = (OntologyClassTreeObject) currNode.getUserObject();
OntologyClass oc = octo.getOntologyClass();
if (oc==null) {
return;
}
currProject.subOntologyRemove(oc.getOntologyMainClass());
} else {
System.out.println("Unknown ActionCommand: " + actCMD);
}
}
示例3: showErrorMessage
import javax.swing.JOptionPane; //导入方法依赖的package包/类
@Override
public void showErrorMessage(String msgText, String msgHead) {
JOptionPane.showInternalMessageDialog(this, msgText, msgHead, JOptionPane.ERROR_MESSAGE);
}