List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE
int INFORMATION_MESSAGE
To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.
Click Source Link
From source file:biz.wolschon.finance.jgnucash.actions.ImportPluginMenuAction.java
@Override public void actionPerformed(final ActionEvent e) { try {/*from ww w . jav a 2 s . c o m*/ GnucashWritableFile wModel = myJGnucashEditor.getWritableModel(); if (wModel == null) { JOptionPane.showMessageDialog(myJGnucashEditor, "No open file.", "Please open a gnucash-file first!", JOptionPane.WARNING_MESSAGE); return; } // Activate plug-in that declares extension. myJGnucashEditor.getPluginManager().activatePlugin(ext.getDeclaringPluginDescriptor().getId()); // Get plug-in class loader. ClassLoader classLoader = myJGnucashEditor.getPluginManager() .getPluginClassLoader(ext.getDeclaringPluginDescriptor()); // Load Tool class. Class toolCls = classLoader.loadClass(ext.getParameter("class").valueAsString()); // Create Tool instance. Object o = toolCls.newInstance(); if (!(o instanceof ImporterPlugin)) { LOGGER.error("Plugin '" + pluginName + "' does not implement ImporterPlugin-interface."); JOptionPane.showMessageDialog(myJGnucashEditor, "Error", "Plugin '" + pluginName + "' does not implement ImporterPlugin-interface.", JOptionPane.ERROR_MESSAGE); return; } ImporterPlugin importer = (ImporterPlugin) o; try { myJGnucashEditor.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); GnucashWritableAccount selectedAccount = (GnucashWritableAccount) myJGnucashEditor .getSelectedAccount(); String message = importer.runImport(wModel, selectedAccount); if (message != null && message.length() > 0) { JOptionPane.showMessageDialog(myJGnucashEditor, "Import OK", "The import was a success:\n" + message, JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e1) { LOGGER.error("Import via Plugin '" + pluginName + "' failed.", e1); JOptionPane .showMessageDialog( myJGnucashEditor, "Error", "Import via Plugin '" + pluginName + "' failed.\n" + "[" + e1.getClass().getName() + "]: " + e1.getMessage(), JOptionPane.ERROR_MESSAGE); } finally { myJGnucashEditor.setCursor(Cursor.getDefaultCursor()); } } catch (Exception e1) { LOGGER.error("Could not activate requested import-plugin '" + pluginName + "'.", e1); JOptionPane .showMessageDialog( myJGnucashEditor, "Error", "Could not activate requested import-plugin '" + pluginName + "'.\n" + "[" + e1.getClass().getName() + "]: " + e1.getMessage(), JOptionPane.ERROR_MESSAGE); } }
From source file:net.sf.jabref.importer.fetcher.JSTORFetcher2.java
@Override public boolean processQuery(String query, ImportInspector dialog, OutputPrinter status) { stopFetching = false;/*from w w w.j ava2 s . c om*/ try { List<String> citations = getCitations(query, dialog, status); //System.out.println("JSTORFetcher2 processQuery within list"); if (citations == null) { return false; } //System.out.println("JSTORFetcher2 processQuery after false citations=" + citations); if (citations.isEmpty()) { if (!noAccessFound) { status.showMessage(Localization.lang("No entries found for the search string '%0'", query), Localization.lang("Search %0", "JSTOR"), JOptionPane.INFORMATION_MESSAGE); } else { status.showMessage(Localization .lang("No entries found. It looks like you do not have access to search JStor.", query), Localization.lang("Search %0", "JSTOR"), JOptionPane.INFORMATION_MESSAGE); } return false; } int i = 0; for (String cit : citations) { if (stopFetching) { break; } getSingleCitation(cit).ifPresent(dialog::addEntry); dialog.setProgress(++i, citations.size()); } return true; } catch (IOException e) { LOGGER.error("Problem fetching from JSTOR", e); status.showMessage(Localization.lang("Error while fetching from %0", "JSTOR") + ": " + e.getMessage()); } return false; }
From source file:com.smanempat.controller.ControllerClassification.java
public void chooseFile(ActionEvent evt, JTextField txtFileDirectory, JTextField txtNumberOfK, JLabel labelJumlahData, JButton buttonProses, JTable tablePreview) { try {// w ww . j ava 2 s. com JFileChooser fileChooser = new JFileChooser(); FileNameExtensionFilter fileNameExtensionFilter = new FileNameExtensionFilter("Excel File", "xls", "xlsx"); fileChooser.setFileFilter(fileNameExtensionFilter); if (fileChooser.showOpenDialog(fileChooser) == JFileChooser.APPROVE_OPTION) { txtFileDirectory.setText(fileChooser.getSelectedFile().getAbsolutePath()); System.out.println("Good, File Chooser runing well!"); if (txtFileDirectory.getText().endsWith(".xls") || txtFileDirectory.getText().endsWith(".xlsx")) { showOnTable(evt, txtFileDirectory, tablePreview); labelJumlahData.setText(tablePreview.getRowCount() + " Data"); txtNumberOfK.setEnabled(true); txtNumberOfK.requestFocus(); buttonProses.setEnabled(true); } else { JOptionPane.showMessageDialog(null, "File dataset harus file spreadsheet dengan ekstensi *xls atau *.xlsx!", "Error", JOptionPane.INFORMATION_MESSAGE, new ImageIcon("src/com/smanempat/image/fail.png")); txtFileDirectory.setText(""); chooseFile(evt, txtFileDirectory, txtNumberOfK, labelJumlahData, buttonProses, tablePreview); } } } catch (Exception e) { e.printStackTrace(); } }
From source file:com.emr.utilities.SqliteAddProcess.java
protected void done() { Boolean success = null;//from ww w . jav a2s .co m try { success = get(); } catch (InterruptedException ex) { Logger.getLogger(EditMappingsForm.class.getName()).log(Level.SEVERE, null, ex); success = false; } catch (ExecutionException ex) { Logger.getLogger(EditMappingsForm.class.getName()).log(Level.SEVERE, null, ex); success = false; } if (success) { JOptionPane.showMessageDialog(null, "Successfully saved process", "Success", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(null, "Could not save process. Error details: " + error_msg, "Failed", JOptionPane.ERROR_MESSAGE); } jp.setIndeterminate(false); lbl.setText("<html><b color='green'>Done!</b></html>"); }
From source file:Simulator.java
private int GetRoutedTravelTime(Coordinate start, Coordinate end) { DefaultHttpClient httpclient = new DefaultHttpClient(); try {/*from ww w . j av a 2s . com*/ // specify the get request HttpGet getRequest = new HttpGet("http://dev.virtualearth.net/REST/V1/Routes/Driving" + "?wp.0=" + start.getLat() + "," + start.getLon() + "&wp.1=" + end.getLat() + "," + end.getLon() + "&ra=routeSummariesOnly" + "&key=Ah2BJh4cdLWewXKf-u5I98pNrwtZz6JJxfCnbC-5M4GTBeHKDbQdzxtOP8yypEmU"); HttpResponse httpResponse = httpclient.execute(getRequest); HttpEntity entity = httpResponse.getEntity(); if (entity != null) { return GetTravelTime(entity); } else { JOptionPane.showMessageDialog(null, "Something went wrong, could not request route information", "InfoBox: " + "Uh Oh.", JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { e.printStackTrace(); } finally { // When HttpClient instance is no longer needed, // shut down the connection manager to ensure // immediate deallocation of all system resources httpclient.getConnectionManager().shutdown(); } return 0; }
From source file:edu.harvard.i2b2.query.serviceClient.QueryRequestClient.java
public static String sendQueryRequestSOAP(String XMLstr) { try {/*www . jav a2 s . co m*/ HttpTransportProperties.Authenticator basicAuthentication = new HttpTransportProperties.Authenticator(); basicAuthentication.setUsername(UserInfoBean.getInstance().getUserName()); basicAuthentication.setPassword(UserInfoBean.getInstance().getUserPassword()); OMElement payload = getQueryPayLoad(XMLstr); Options options = new Options(); // options.setProperty(HTTPConstants.PROXY, proxyProperties); targetEPR = new EndpointReference(getCRCNavigatorQueryProcessorServiceName()); options.setTo(targetEPR); options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setTimeOutInMilliSeconds(200000); ConfigurationContext configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(null, null); // Blocking invocation ServiceClient sender = new ServiceClient(configContext, null); sender.setOptions(options); OMElement result = sender.sendReceive(payload); // System.out.println(result.toString()); return result.toString(); } catch (AxisFault axisFault) { axisFault.printStackTrace(); if (axisFault.getMessage().indexOf("No route to host") >= 0) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, "Unable to make a connection to the remote server,\n this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); } else if (axisFault.getMessage().indexOf("Read timed out") >= 0) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, "Unable to obtain a response from the remote server, this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); } return null; } catch (Exception e) { e.printStackTrace(); return null; } }
From source file:com.heliosdecompiler.helios.Helios.java
public static void displayError(Throwable t) { t.printStackTrace();/*from ww w.j a va 2s . c o m*/ StringWriter writer = new StringWriter(); t.printStackTrace(new PrintWriter(writer)); JOptionPane.showMessageDialog(null, writer.toString(), t.getClass().getSimpleName(), JOptionPane.INFORMATION_MESSAGE); }
From source file:gov.nih.nci.nbia.StandaloneDMV3.java
void checkCompatibility() { if (serverUrl.endsWith("DownloadServlet")) { this.serverUrl = serverUrl.concat("V3"); }/*from ww w .ja va 2 s. c om*/ if (!serverUrl.endsWith("DownloadServletV3")) { Object[] options = { "OK" }; int n = JOptionPane.showOptionDialog(frame, serverVersionMsg, "Incompatible Server Notification", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]); System.exit(n); } }
From source file:eu.apenet.dpt.standalone.gui.MessageReportActionListener.java
public void actionPerformed(ActionEvent e) { JList xmlEadList = dataPreparationToolGui.getXmlEadList(); String defaultOutputDirectory = retrieveFromDb.retrieveDefaultSaveFolder(); StringBuffer stringBuffer = new StringBuffer(); if (stringBuffer.toString() != null && stringBuffer.toString().equals("")) LOG.info(stringBuffer.toString()); if (stringBuffer.toString() == null) LOG.info("StringBuffer is null"); if (stringBuffer.toString().equals("")) LOG.info("StringBuffer is empty"); for (Object selectedValue : xmlEadList.getSelectedValues()) { File selectedFile = (File) selectedValue; String filename = selectedFile.getName(); FileInstance fileInstance = fileInstances.get(filename); //todo: do we really need this? filename = filename.startsWith("temp_") ? filename.replace("temp_", "") : filename; if (!fileInstance.getConversionErrors().isEmpty() || !fileInstance.getValidationErrors().isEmpty() || !fileInstance.getEuropeanaConversionErrors().isEmpty()) { stringBuffer.append("========================================\r\n"); stringBuffer.append(filename); stringBuffer.append("\r\n"); stringBuffer.append("========================================\r\n"); }/*from w ww. ja va2 s .co m*/ if (!fileInstance.getConversionErrors().isEmpty()) { stringBuffer.append(fileInstance.getConversionErrors()); stringBuffer.append("\r\n"); } if (!fileInstance.getValidationErrors().isEmpty()) { stringBuffer.append(fileInstance.getValidationErrors()); stringBuffer.append("\r\n"); } if (!fileInstance.getEuropeanaConversionErrors().isEmpty()) { stringBuffer.append(fileInstance.getEuropeanaConversionErrors()); stringBuffer.append("\r\n"); } } try { if (stringBuffer.toString().equals("")) JOptionPane.showMessageDialog(parent, labels.getString("noReportData"), labels.getString("noReportDataHeader"), JOptionPane.INFORMATION_MESSAGE, Utilities.icon); else { FileUtils.writeStringToFile(new File(defaultOutputDirectory + "/report.txt"), stringBuffer.toString()); JOptionPane.showMessageDialog(parent, MessageFormat.format(labels.getString("filesInOutput"), defaultOutputDirectory) + ".", labels.getString("fileSaved"), JOptionPane.INFORMATION_MESSAGE, Utilities.icon); } } catch (IOException ex) { java.util.logging.Logger.getLogger(MessageReportActionListener.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } }
From source file:com.emr.utilities.DatabaseManager.java
/** * Save database settings to a properties file * @param fileName {@link String} Properties file name * @param prefix {@link String} Prefix of the fields (emr|mpi) *//* w w w . j a v a2 s . com*/ public void saveSettings(String fileName, String prefix) { try { output = new FileOutputStream("config/" + fileName); // set the properties value prop.setProperty(prefix + "_servername", servername); prop.setProperty(prefix + "_port", port); prop.setProperty(prefix + "_url", url); prop.setProperty(prefix + "_dbname", dbName); prop.setProperty(prefix + "_dbuser", userName); prop.setProperty(prefix + "_dbpassword", password); // save properties to project root folder prop.store(output, null); JOptionPane.showMessageDialog(null, "Connection Settings successfully saved.", "Save Connection Settings", JOptionPane.INFORMATION_MESSAGE); } catch (IOException io) { JOptionPane.showMessageDialog(null, "I/O Error: " + io.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } finally { if (output != null) { try { output.close(); } catch (IOException e) { //e.printStackTrace(); } } } }