Java Code Examples for javax.swing.JOptionPane.showInternalMessageDialog()

The following are Jave code examples for showing how to use showInternalMessageDialog() of the javax.swing.JOptionPane class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AgentWorkbench   File: OntologyClassTree.java   View Source Code Vote up 5 votes
/**
 * 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;
	}
	
}
 
Example 2
Project: AgentWorkbench   File: OntologyTab.java   View Source Code Vote up 4 votes
@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);
	}
}
 
Example 3
Project: AgentWorkbench   File: ProjectWindow.java   View Source Code Vote up 4 votes
@Override
public void showErrorMessage(String msgText, String msgHead) {
	JOptionPane.showInternalMessageDialog(this, msgText, msgHead, JOptionPane.ERROR_MESSAGE);
}