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:net.pms.encoders.AviSynthFFmpeg.java
@Override protected JComponent config(String languageLabel) { FormLayout layout = new FormLayout("left:pref, 0:grow", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu"); PanelBuilder builder = new PanelBuilder(layout); builder.border(Borders.EMPTY);/*from ww w.ja v a2 s . c o m*/ builder.opaque(false); CellConstraints cc = new CellConstraints(); JComponent cmp = builder.addSeparator(Messages.getString(languageLabel), cc.xyw(2, 1, 1)); cmp = (JComponent) cmp.getComponent(0); cmp.setFont(cmp.getFont().deriveFont(Font.BOLD)); multithreading = new JCheckBox(Messages.getString("MEncoderVideo.35"), configuration.isFfmpegAviSynthMultithreading()); multithreading.setContentAreaFilled(false); multithreading.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { configuration.setFfmpegAviSynthMultithreading(e.getStateChange() == ItemEvent.SELECTED); } }); builder.add(GuiUtil.getPreferredSizeComponent(multithreading), cc.xy(2, 3)); interframe = new JCheckBox(Messages.getString("AviSynthMEncoder.13"), configuration.getFfmpegAvisynthInterFrame()); interframe.setContentAreaFilled(false); interframe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { configuration.setFfmpegAvisynthInterFrame(interframe.isSelected()); if (configuration.getFfmpegAvisynthInterFrame()) { JOptionPane.showMessageDialog( SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame()), Messages.getString("AviSynthMEncoder.16"), Messages.getString("Dialog.Information"), JOptionPane.INFORMATION_MESSAGE); } } }); builder.add(GuiUtil.getPreferredSizeComponent(interframe), cc.xy(2, 5)); interframegpu = new JCheckBox(Messages.getString("AviSynthMEncoder.15"), configuration.getFfmpegAvisynthInterFrameGPU()); interframegpu.setContentAreaFilled(false); interframegpu.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { configuration.setFfmpegAvisynthInterFrameGPU((e.getStateChange() == ItemEvent.SELECTED)); } }); builder.add(GuiUtil.getPreferredSizeComponent(interframegpu), cc.xy(2, 7)); convertfps = new JCheckBox(Messages.getString("AviSynthMEncoder.3"), configuration.getFfmpegAvisynthConvertFps()); convertfps.setContentAreaFilled(false); convertfps.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { configuration.setFfmpegAvisynthConvertFps((e.getStateChange() == ItemEvent.SELECTED)); } }); builder.add(GuiUtil.getPreferredSizeComponent(convertfps), cc.xy(2, 9)); configuration.addConfigurationListener(new ConfigurationListener() { @Override public void configurationChanged(ConfigurationEvent event) { if (event.getPropertyName() == null) { return; } if ((!event.isBeforeUpdate()) && event.getPropertyName().equals(PmsConfiguration.KEY_GPU_ACCELERATION)) { interframegpu.setEnabled(configuration.isGPUAcceleration()); } } }); return builder.getPanel(); }
From source file:com.qframework.core.GameonApp.java
private void onTextInput(final String resptype, final String respdata) { Timer t = new javax.swing.Timer(50, new ActionListener() { public void actionPerformed(ActionEvent e) { JTextField area = new JTextField(resptype); area.setFocusable(true);/* w w w . ja v a 2 s . c o m*/ area.requestFocus(); Object options[] = new Object[] { area }; Frame parent = null; if (mAppContext != null) parent = (Frame) SwingUtilities.getAncestorOfClass(java.awt.Frame.class, mAppContext); else parent = (Frame) SwingUtilities.getAncestorOfClass(java.awt.Frame.class, mAppletContext); int option = JOptionPane.showOptionDialog(parent, options, "", JOptionPane.YES_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null); if (option == JOptionPane.YES_OPTION) { String truncated = area.getText().replaceAll("[^A-Za-z0-9:.@ ]", ""); String script = respdata + "('" + truncated + "' , 1);"; mScript.execScript(script); } else { String script = respdata + "(undefined, 1);"; mScript.execScript(script); } } }); t.setRepeats(false); t.start(); }
From source file:com.iucosoft.eavertizare.gui.SendAvertizareManualJDialog.java
private void jButtonSendAvertizareActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSendAvertizareActionPerformed String mesaj = ""; int contor = 0; SimpleDateFormat sdf = new SimpleDateFormat("dd/M/yyyy"); String mesajClient = jTextAreaMesaj.getText().replaceFirst("nume", client.getNume()) .replaceFirst("prenume", client.getPrenume()) .replaceFirst("data", sdf.format(client.getDateExpirare()).toString()) .replaceFirst("compania", client.getFirma().getNumeFirma()); switch (varianta) { case "SMS AND E-MAIL": mesaj = "Sms si e-mail"; try {/*from ww w. ja va2s . c om*/ mailSender.sendMail(client.getEmail(), "E-avertizare", mesajClient); smsSender.sendSms(client.getNrTelefon(), mesajClient); } catch (Exception ex) { //Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(new JFrame(), "Verificai conexiunea la internet!\n" + ex, "Error", JOptionPane.ERROR_MESSAGE); contor = 1; } client.setTrimis(true); clientsDao.update(client.getFirma(), client); parent.refreshFrame(); break; case "SMS": mesaj = "Sms"; try { smsSender.sendSms(client.getNrTelefon(), mesajClient); } catch (Exception ex) { //Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(new JFrame(), "Verificai conexiunea la internet!\n" + ex, "Error", JOptionPane.ERROR_MESSAGE); contor = 1; } break; case "E-MAIL": mesaj = "E-mail"; try { mailSender.sendMail(client.getEmail(), "E-avertizare", mesajClient); } catch (Exception ex) { //Logger.getLogger(MainJFrame.class.getName()).log(Level.SEVERE, null, ex); JOptionPane.showMessageDialog(new JFrame(), "Verificai conexiunea la internet!\n" + ex, "Error", JOptionPane.ERROR_MESSAGE); contor = 1; } break; } this.dispose(); if (contor != 1) { JOptionPane.showMessageDialog(parent, mesaj + " transmis cu succes!", "Info", JOptionPane.INFORMATION_MESSAGE); } }
From source file:client.ui.Container.java
public void test(String URL) throws IOException, MalformedURLException { Thread worker = new Thread() { public void run() { String error = null;/*from w w w. j a v a2 s . c o m*/ try { int http = 0; int h2 = 0; URL entry = new URL(URL); Request request = new Request.Builder().url(entry.toString()).build(); Response response = httpClient.newCall(request).execute(); log("Getting urls to test from: " + entry.toString()); JSONObject json = new JSONObject(response.body().string()); JSONArray urls = json.getJSONArray("urls"); progress.setMaximum(urls.length()); progress.setIndeterminate(false); SocketFactory factory = SSLSocketFactory.getDefault(); JSONArray certs = new JSONArray(); for (int i = 0; i < urls.length(); ++i) { URL url = new URL(urls.getString(i)); if ("https".equals(url.getProtocol())) { certs.put(getCert(factory, url)); } response = request(httpClient, url); if (response != null) { http++; } response = request(http2Client, url); if (response != null) { h2++; } progress.setValue(progress.getValue() + 1); } URL finish = new URL(entry.getProtocol(), entry.getHost(), entry.getPort(), json.getString("finish")); json = new JSONObject(); json.put("certs", certs); response = request(httpClient, finish, json.toString()); json = new JSONObject(response.body().string()); String vcode = json.getString("vcode"); if (vcode.length() > 0) { vcodeLabel.setText("Please, copy the VCODE:"); vcodeOutput.setText(vcode); vcodeOutput.setEnabled(true); } JOptionPane.showMessageDialog(Container.this, "Successful requests: " + "\nHTTP/1.1: " + Integer.toString(http) + "/" + Integer.toString(urls.length()) + "\nHTTP/2: " + Integer.toString(h2) + "/" + Integer.toString(urls.length()), "Completed!", JOptionPane.INFORMATION_MESSAGE); } catch (Exception e) { error = e.getMessage(); } if (error != null) { System.out.println(error); JOptionPane.showMessageDialog(Container.this, "Error: " + error, "Error", JOptionPane.ERROR_MESSAGE); progress.setIndeterminate(false); progress.setValue(0); } campaignInput.setEnabled(true); workerInput.setEnabled(true); urlInput.setEnabled(true); button.setEnabled(true); } }; worker.start(); }
From source file:EscribirCorreo.java
private void responderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_responderActionPerformed // Responder/Enviar correo MySqlC mysql = new MySqlC(); mysql.conn();//from w w w. ja v a 2 s . c om Date date = new Date(); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); DateFormat hourFormat = new SimpleDateFormat("HH:mm:ss"); String fecha = dateFormat.format(date); String hora = hourFormat.format(date); String ienviadop = usuario; String irecibidop = para.getText(); String iasunto = asuntoField.getText(); String itexto = textoField.getText(); existe = mysql.compruebaEnv(irecibidop); if ((irecibidop.trim().length() == 0) || (iasunto.trim().length() == 0) || (itexto.trim().length() == 0)) { JOptionPane.showMessageDialog(null, "Faltan campos por cubrir", "Error", JOptionPane.ERROR_MESSAGE); } else if (existe == false) { JOptionPane.showMessageDialog(null, "El usuario al que quieres enviar el correo no existe", "Error", JOptionPane.ERROR_MESSAGE); } else { mysql.accion("Insert into correos (enviadop,recibidop,asunto,texto,fecha, hora, archivos) values ('" + ienviadop + "','" + irecibidop + "','" + iasunto + "','" + itexto + "','" + fecha + "','" + hora + "','" + archivos + "')"); JOptionPane.showMessageDialog(null, "Correo enviado correctamente", "Enviado!", JOptionPane.INFORMATION_MESSAGE); this.dispose(); mysql.close(); } }
From source file:UserInterface.AdministrativeRole.RequestAnalysis.java
private void ExportBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExportBtnActionPerformed // TODO add your handling code here: try {//from w w w . j ava2 s . c om if (enterprise.getOrganizationDirectory().getOrganizationList().size() > 0) { Organization organization = null; //System.out.println(enterprise.getOrganizationDirectory().getOrganizationList().size()); for (Organization org : enterprise.getOrganizationDirectory().getOrganizationList()) { if (org instanceof ProcurementOrganization) { organization = org; //System.out.println(organization); break; } } FileWriter writer = new FileWriter(System.getProperty("user.dir") + "\\test.csv"); //in = new FileInputStream(new File (System.getProperty("user.dir")+"\\Sound.wav")); writer.append("Request ID"); writer.append(','); writer.append("Requester"); writer.append(','); writer.append("Requester Organization"); writer.append(','); writer.append("Machine Name"); writer.append(','); writer.append("Machine Status"); writer.append(','); writer.append("Requested Date"); writer.append(','); writer.append("Total Price"); writer.append(','); writer.append("Requester Message"); writer.append(','); writer.append('\n'); if (organization.getWorkQueue().getWorkRequestList().size() > 0) { for (WorkRequest request : organization.getWorkQueue().getWorkRequestList()) { writer.append(String.valueOf(request.getWorkRequestId())); writer.append(','); writer.append(request.getSender().getUsername()); writer.append(','); writer.append(request.getOrg().getName()); writer.append(','); writer.append(request.getMachine().getMachineName()); writer.append(','); writer.append(request.getMachine().getSensorData().getSensorVlaue()); writer.append(','); writer.append(request.getRequestDate().toString()); writer.append(','); writer.append(String.valueOf(request.getTotalPrice())); writer.append(','); writer.append(request.getMessage()); writer.append(','); writer.append('\n'); } } writer.flush(); writer.close(); JOptionPane.showMessageDialog(this, "Record Exported Successfully", "Export", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(null, "No Organization Present"); } } catch (Exception e) { System.out.println("inside"); System.out.println(e.getMessage()); } }
From source file:gov.nih.nci.nbia.StandaloneDMDispatcher.java
private void constructDownloadPanelWithOption(String downloadUrl, Object[] options) { String nVMsg = newVersionMsg; if (os.equalsIgnoreCase("CentOS") || os.equalsIgnoreCase("Ubuntu")) { nVMsg = nVMsg + "\nIf choosing Update automatically, you need to enter a sudo password later."; }//from w ww .ja va 2 s .c o m if (os.startsWith("mac")) { JOptionPane.showMessageDialog(null, "New version is available on App Store. Please upgrade."); if (options.length == 2) { // forced upgrade needed System.exit(1); } else { nogo = false; return; } } int n = JOptionPane.showOptionDialog(null, nVMsg, "New Version Notification", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]); if (n == 0) { saveAndInstall(downloadUrl); nogo = true; } else if (n == 1) { try { saveFile(downloadUrl); nogo = false; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (n == 2) { nogo = false; } }
From source file:de.lazyzero.kkMulticopterFlashTool.KKMulticopterFlashTool.java
private void checkVersion() { logger.log(Level.INFO, "Check the version: " + VERSION + (isBeta ? " beta " + betaVersion : "") + " online is version: " + firmwareReader.getActualVersion()); if (firmwareReader.getActualVersion() > Double.parseDouble(VERSION)) { // JOptionPane.showMessageDialog(this, _("update")); String[] choices = { _("downloads.download"), _("Cancel") }; int result = JOptionPane.showOptionDialog(this, _("update"), "", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, choices, choices[0]); if (result == 0) { kkMenu.openURL("http://kkflashtool.de"); System.exit(0);/*from ww w . j a v a 2 s.co m*/ } } }
From source file:com.cactus.ClientRegisterGUI.java
private void Register_ButtonActionPerformed(ActionEvent evt) throws Exception {//GEN-FIRST:event_Register_ButtonActionPerformed String userName = Username_TextField.getText(); String userEmail = Email_TextField.getText(); String userEmailConfirm = Email_Confirm_TextField.getText(); String userPass = String.valueOf(Password_TextField.getPassword()); String userPassConfirm = String.valueOf(Confirm_Password_TextField.getPassword()); //check to see if any of the fields are empty, remove this check from php file //figure out a way to validate email format if (Email_Check(userEmail, userEmailConfirm)) { //checks to see if the passwords match if (userPass.equals(userPassConfirm)) { //turning the parameters into a JSON object that is sent to the server to process CloseableHttpClient client = HttpClients.createDefault(); HttpPost httpPost = new HttpPost("https://teamcactus.us/Register.php"); String json = "{\"userName\":\"" + userName + "\",\"userPass\":\"" + userPass + "\",\"userEmail\":\"" + userEmail + "\"}"; StringEntity entity = new StringEntity(json); httpPost.setEntity(entity);//from www . j a va 2s . co m httpPost.setHeader("Accept", "application/json"); httpPost.setHeader("Content-type", "application/json"); HttpResponse response = client.execute(httpPost); // Getting the status code. //int statusCode = response.getStatusLine().getStatusCode(); // Getting the response body. String responseBody = EntityUtils.toString(response.getEntity()); JSONObject obj = new JSONObject(responseBody); //System.out.println(responseBody); String status = obj.getString("status"); String msg = obj.getString("msg"); if (status.equals("success")) { JOptionPane.showMessageDialog(null, msg, "Success!", JOptionPane.INFORMATION_MESSAGE); this.dispose(); new ClientLoginGUI().setVisible(true); } else { //specify types of error messages when registering. //User already exists in database JOptionPane.showMessageDialog(null, msg, "Error", JOptionPane.ERROR_MESSAGE); } } else { //error message when the passwords enter do not match JOptionPane.showMessageDialog(null, "Passwords do not match.", "Error", JOptionPane.ERROR_MESSAGE); } //generate a private and public key and write both to a file RSA myRSA = new RSA(); myRSA.writeKeysToFiles(); } }
From source file:net.sf.keystore_explorer.gui.dialogs.DViewCertCsrPem.java
private void exportPressed() { File chosenFile = null;/* w w w.j a va 2 s.c o m*/ FileWriter fw = null; String title; if (cert != null) { title = res.getString("DViewCertCsrPem.ExportPemCertificate.Title"); } else { title = res.getString("DViewCertCsrPem.ExportPemCsr.Title"); } try { String certPem = jtaPem.getText(); JFileChooser chooser = FileChooserFactory.getX509FileChooser(); chooser.setCurrentDirectory(CurrentDirectory.get()); chooser.setDialogTitle(title); chooser.setMultiSelectionEnabled(false); int rtnValue = JavaFXFileChooser.isFxAvailable() ? chooser.showSaveDialog(this) : chooser.showDialog(this, res.getString("DViewCertCsrPem.ChooseExportFile.button")); if (rtnValue != JFileChooser.APPROVE_OPTION) { return; } chosenFile = chooser.getSelectedFile(); CurrentDirectory.updateForFile(chosenFile); if (chosenFile.isFile()) { String message = MessageFormat.format(res.getString("DViewCertCsrPem.OverWriteFile.message"), chosenFile); int selected = JOptionPane.showConfirmDialog(this, message, title, JOptionPane.YES_NO_OPTION); if (selected != JOptionPane.YES_OPTION) { return; } } fw = new FileWriter(chosenFile); fw.write(certPem); } catch (FileNotFoundException ex) { JOptionPane.showMessageDialog(this, MessageFormat.format(res.getString("DViewCertCsrPem.NoWriteFile.message"), chosenFile), title, JOptionPane.WARNING_MESSAGE); return; } catch (Exception ex) { DError.displayError(this, ex); return; } finally { IOUtils.closeQuietly(fw); } JOptionPane.showMessageDialog(this, res.getString("DViewCertCsrPem.ExportPemCertificateSuccessful.message"), title, JOptionPane.INFORMATION_MESSAGE); }