Example usage for javax.swing JOptionPane INFORMATION_MESSAGE

List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE

Introduction

In this page you can find the example usage for javax.swing JOptionPane INFORMATION_MESSAGE.

Prototype

int INFORMATION_MESSAGE

To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.

Click Source Link

Document

Used for information messages.

Usage

From source file:gui.InboxPanel.java

private void showMsgDialog(String title, String message) {
    JOptionPane.showMessageDialog(null, message, title, JOptionPane.INFORMATION_MESSAGE);
}

From source file:ConfigFiles.java

public static void saveXML(boolean blank, String filename) {
    boolean saved = true;
    try {//  w  ww  .  ja  v  a  2  s.  c  o  m
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.newDocument();
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
        DOMSource source = new DOMSource(document);
        Comment simpleComment = document.createComment(
                "\n Master config file for TSC.\n \n Logs" + " Path: Where CE and PE write their getLogs()."
                        + " Reports Path: Where all reports are saved.\n "
                        + "Test Suite Config: All info about the current " + "Test Suite (Test Plan).\n");
        document.appendChild(simpleComment);
        Element root = document.createElement("Root");
        document.appendChild(root);
        Element rootElement = document.createElement("FileType");
        root.appendChild(rootElement);
        rootElement.appendChild(document.createTextNode("config"));
        try {
            addTag("CentralEnginePort", tceport.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("CentralEnginePort", "", root, blank, document);
        }
        //             try{addTag("ResourceAllocatorPort",traPort.getText(),root,blank,document);}
        //             catch(Exception e){addTag("ResourceAllocatorPort","",root,blank,document);}
        //             try{addTag("HttpServerPort",thttpPort.getText(),root,blank,document);}
        //             catch(Exception e){addTag("HttpServerPort","",root,blank,document);}
        try {
            addTag("TestCaseSourcePath", ttcpath.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("TestCaseSourcePath", "", root, blank, document);
        }
        try {
            addTag("LibsPath", libpath.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("LibsPath", "", root, blank, document);
        }
        try {
            addTag("UsersPath", tUsers.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("UsersPath", "", root, blank, document);
        }
        try {
            addTag("PredefinedSuitesPath", tSuites.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("PredefinedSuitesPath", "", root, blank, document);
        }

        try {
            addTag("ArchiveLogsPath", tsecondarylog.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("ArchiveLogsPath", "", root, blank, document);
        }
        try {
            addTag("ArchiveLogsPathActive", logsenabled.isSelected() + "", root, blank, document);
        } catch (Exception e) {
            addTag("ArchiveLogsPath", "", root, blank, document);
        }

        try {
            addTag("LogsPath", tlog.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("LogsPath", "", root, blank, document);
        }
        rootElement = document.createElement("LogFiles");
        root.appendChild(rootElement);
        try {
            addTag("logRunning", trunning.getText(), rootElement, blank, document);
        } catch (Exception e) {
            addTag("logRunning", "", rootElement, blank, document);
        }
        try {
            addTag("logDebug", tdebug.getText(), rootElement, blank, document);
        } catch (Exception e) {
            addTag("logDebug", "", rootElement, blank, document);
        }
        try {
            addTag("logSummary", tsummary.getText(), rootElement, blank, document);
        } catch (Exception e) {
            addTag("logSummary", "", rootElement, blank, document);
        }
        try {
            addTag("logTest", tinfo.getText(), rootElement, blank, document);
        } catch (Exception e) {
            addTag("logTest", "", rootElement, blank, document);
        }
        try {
            addTag("logCli", tcli.getText(), rootElement, blank, document);
        } catch (Exception e) {
            addTag("logCli", "", rootElement, blank, document);
        }
        try {
            addTag("DbConfigFile", tdbfile.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("DbConfigFile", "", root, blank, document);
        }
        try {
            addTag("EpNames", tepid.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("EpNames", "", root, blank, document);
        }
        try {
            addTag("EmailConfigFile", temailfile.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("EmailConfigFile", "", root, blank, document);
        }
        try {
            addTag("GlobalParams", tglobalsfile.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("GlobalParams", "", root, blank, document);
        }
        try {
            addTag("TestConfigPath", testconfigpath.getText(), root, blank, document);
        } catch (Exception e) {
            addTag("TestConfigPath", "", root, blank, document);
        }
        String temp;
        if (blank)
            temp = "fwmconfig";
        else
            temp = filename;
        File file = new File(RunnerRepository.temp + RunnerRepository.getBar() + "Twister"
                + RunnerRepository.getBar() + temp + ".xml");
        Result result = new StreamResult(file);
        transformer.transform(source, result);
        System.out.println("Saving to: " + RunnerRepository.USERHOME + "/twister/config/");
        FileInputStream in = new FileInputStream(file);
        RunnerRepository.uploadRemoteFile(RunnerRepository.USERHOME + "/twister/config/", in, file.getName());
    } catch (ParserConfigurationException e) {
        System.out
                .println("DocumentBuilder cannot be created which" + " satisfies the configuration requested");
        saved = false;
    } catch (TransformerConfigurationException e) {
        System.out.println("Could not create transformer");
        saved = false;
    } catch (Exception e) {
        e.printStackTrace();
        saved = false;
    }
    if (saved) {
        CustomDialog.showInfo(JOptionPane.INFORMATION_MESSAGE, RunnerRepository.window, "Successful",
                "File successfully saved");
    } else {
        CustomDialog.showInfo(JOptionPane.WARNING_MESSAGE, RunnerRepository.window.mainpanel.p4.getConfig(),
                "Warning", "File could not be saved ");
    }
}

From source file:junk.gui.HazardDataSetCalcCondorApp.java

/**
 *
 *//*from w  w w.j a va 2s  . c  o m*/
public void run() {
    timer.start();
    try {
        step = 1;
        //use the default values for IML's if user does not specifies any custom values.
        if (!useCustomX_Values)
            function = imtInfo.getDefaultHazardCurve(imtGuiBean.getSelectedIMT());
        //this connects to the servlet on web server to check if dataset name already exists
        //or computation have already been for these parameter settings.
        if (distanceControlPanel == null)
            maxDistance = new Double(HazardCurveCalculator.MAX_DISTANCE_DEFAULT);
        else
            maxDistance = new Double(distanceControlPanel.getDistance());
        Object obj = checkForHazardMapComputation();
        if (obj instanceof String) {
            JOptionPane.showMessageDialog(this, (String) obj);
            step = 0;
            return;
        } else if (obj instanceof Boolean) { // if it is the instance of boolean which return true always
            //meaning it is safe to proceeed with the calculation and the name of the dataset that user
            //has specified.
            // get the selected IMR
            ScalarIntensityMeasureRelationshipAPI imr = imrGuiBean.getSelectedIMR_Instance();
            step = 2;
            //gets the instance of the selected ERF
            String eqkRupForecastLocation = erfGuiBean.saveSelectedERF();
            // this function will get the selected IMT parameter and set it in IMT
            imtGuiBean.setIMT();
            SitesInGriddedRegion griddedRegionSites = sitesGuiBean.getGriddedRegionSite();
            step = 3;
            sendParametersToServlet(griddedRegionSites, imr, eqkRupForecastLocation);
            step = 0;
        }
    } catch (ParameterException ee) {
        ee.printStackTrace();
        step = 0;
        JOptionPane.showMessageDialog(this, ee.getMessage(), "Invalid Parameters", JOptionPane.ERROR_MESSAGE);
        return;
    } catch (Exception ee) {
        ee.printStackTrace();
        step = 0;
        JOptionPane.showMessageDialog(this, ee.getMessage(), "Input Error", JOptionPane.INFORMATION_MESSAGE);
        return;
    }

}

From source file:com.pianobakery.complsa.LicenseKeyGUI.java

private void useTrialKeyButtonActionPerformed(ActionEvent evt) {

    /**/*w  ww . j a  v  a 2 s. co m*/
     * First validate license and get a temporary license object to
     * check for validation status later.
     */
    License temporaryLicenseObject = LicenseValidator.validate(trialLicKey, publicKey, internalString,
            nameforValidation, companyforValidation, hardwareIDMethod);

    /**
     * If given license key is valid, then save it on disk, and update
     * GUI fields.
     */
    if (temporaryLicenseObject.getValidationStatus() == ValidationStatus.LICENSE_VALID) {
        licenseObject = temporaryLicenseObject;

        try {
            /**
             * We use Apache commons-io (FileUtils class) to easily save
             * string to file.
             */
            FileUtils.writeStringToFile(new File(licenseKeyFileOnDisk), trialLicKey);

            /**
             * Since license key is changed delete license text file if
             * exists on disk left from previous license key.
             */
            FileUtils.deleteQuietly(new File(licenseTextFileOnDisk));
        } catch (IOException ex) {
            Logger.getLogger(LicenseKeyGUI.class.getName()).log(Level.SEVERE, null, ex);
        }

        updateGUIFieldsWithLicenseObject();

        /**
         * We use a SwingWorker here because it will connect to license server
         * for activation, and it may take 2-3 seconds.
         */
        SwingWorker<License, Void> worker = new SwingWorker<License, Void>() {
            @Override
            protected void done() {
                try {
                    /**
                     * Again we get license object to a temporary object to
                     * check for ActivationStatus.
                     */
                    License temporaryLicenseObject = (License) get();

                    /**
                     * If it is successfully activated save on disk and update
                     * GUI fields.
                     */
                    if (temporaryLicenseObject.getActivationStatus() == ActivationStatus.ACTIVATION_COMPLETED) {
                        licenseObject = temporaryLicenseObject;

                        try {
                            /**
                             * We use Apache commons-io (FileUtils class) to
                             * easily save string to file.
                             *
                             * licenseObject.getLicenseString() method returns
                             * activated license string.
                             */
                            FileUtils.writeStringToFile(new File(licenseTextFileOnDisk),
                                    licenseObject.getLicenseString());
                        } catch (IOException ex) {
                            Logger.getLogger(LicenseKeyGUI.class.getName()).log(Level.SEVERE, null, ex);
                        }

                        updateGUIFieldsWithLicenseObject();
                    } else {
                        /**
                         * If activation cannot be completed, display an error
                         * message.
                         */
                        JOptionPane.showMessageDialog(null,
                                "License activation error: " + temporaryLicenseObject.getActivationStatus(),
                                "Activation Error", JOptionPane.ERROR_MESSAGE);
                    }
                } catch (InterruptedException ex) {
                    Logger.getLogger(LicenseKeyGUI.class.getName()).log(Level.SEVERE, null, ex);
                } catch (ExecutionException ex) {
                    Logger.getLogger(LicenseKeyGUI.class.getName()).log(Level.SEVERE, null, ex);
                }

                progressjLabel.setText("");

                /**
                 * Activation progress is complete, enable buttons again.
                 */
                activatejButton.setEnabled(true);
                changeProductKeyjButton.setEnabled(true);
                JOptionPane.showMessageDialog(null, "Please restart to enable the license", "Restart...",
                        JOptionPane.INFORMATION_MESSAGE);
            }

            @Override
            protected License doInBackground() {
                /**
                 * Since example licenses are on Online.License4J the method
                 * below will activate on Online.License4J when autoActivate
                 * method is called without a license server address.
                 */
                return LicenseValidator.autoActivate(licenseObject);

                /**
                 * If you want to test your own "Auto License Generation and
                 * Activation Server" you should give its address as argument
                 * like below.
                 */
                //return LicenseValidator.autoActivate(licenseObject, "http://YourServer.com/algas/autoactivate");
            }
        };
        worker.execute();

        progressjLabel.setText("Activating ...");

        /**
         * It is good to disable "activate" and "change product key" buttons
         * while activation is in progress.
         */
        activatejButton.setEnabled(false);
        changeProductKeyjButton.setEnabled(false);

    } else {
        /**
         * If given license is not valid, display an error message.
         */
        JOptionPane.showMessageDialog(null, "License error: " + temporaryLicenseObject.getValidationStatus(),
                "License Error", JOptionPane.ERROR_MESSAGE);
    }

}

From source file:com.msc.dao.facturierswing.Main.java

private void jButtonCloreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloreActionPerformed
    String resI = JOptionPane.showInputDialog(this, "Clore la facture (n'est plus editable) tappez OUI",
            "ATTENTION", JOptionPane.INFORMATION_MESSAGE);
    if (resI.equals("OUI")) {
        try {// ww  w .  j  a  va  2  s. c  o  m
            Request r = new Request("facture", "ferme/" + jLabelNoFacture.getText());
            Response res = r.sendRequest(null, GET);
            res.consumeToken();
            cloreFactureOrNot(true);
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

From source file:co.com.soinsoftware.hotelero.view.JFRoomPayment.java

private void jbtSaveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jbtSaveActionPerformed
    if (this.validateDataForSave()) {
        final int confirmation = ViewUtils.showConfirmDialog(this, ViewUtils.MSG_SAVE_QUESTION,
                ViewUtils.TITLE_SAVED);//w w  w .  j  a v a  2  s  .  c o m
        if (confirmation == JOptionPane.OK_OPTION) {
            final Invoice invoice = this.getInvoiceSelected();
            final InvoiceStatus invoiceStatus = this.getInvoiceStatusSelected();
            final Date finalDate = this.jdcFinalDate.getDate();
            final long total = this.getTotalValue();
            invoice.setUpdated(new Date());
            invoice.setRoomStatus(roomStatusEnabled);
            invoice.setInvoiceStatus(invoiceStatus);
            invoice.setFinalDate(finalDate);
            invoice.setValue(total);
            this.invoiceController.save(invoice);
            ViewUtils.showMessage(this, ViewUtils.MSG_SAVED, ViewUtils.TITLE_SAVED,
                    JOptionPane.INFORMATION_MESSAGE);
            this.jfRoom.refreshRoomData();
            this.refresh();
        }
    }
}

From source file:com.iucosoft.eavertizare.gui.MainJFrame.java

private void jButtonCautaFirmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCautaFirmaActionPerformed
    if (!jTextFieldCautaFirma.getText().equals("")) {
        firmeListModel.refreshModel(this, jTextFieldCautaFirma.getText());
        clientiTableModel.refreshModel(jTextFieldCautaFirma.getText());
        jTextFieldCautaFirma.setText("");
    } else {/*from w  w w  .  ja va 2 s.  c  o m*/
        JOptionPane.showMessageDialog(this, "Introduceti numele firme!", "Info",
                JOptionPane.INFORMATION_MESSAGE);
    }

}

From source file:Interfaz.rubiktimer.java

private void Limpiar3x3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Limpiar3x3ActionPerformed
    if (img == 2) {
        ConsultaLimpiar dialog = new ConsultaLimpiar(new javax.swing.JFrame(), true, "3 x 3");
        dialog.setVisible(true);// w  w w .j  ava 2s. c  om
        if (dialog.verif == 1) {
            listaT = new Lista();
            listaT3x3 = new Lista();
            lista5mej = new Lista();
            lista5mej3x3 = new Lista();
            lista10mej = new Lista();
            lista10mej3x3 = new Lista();
            panel3x3.removeAll();
            panel3x3.updateUI();
            panelGrafica.removeAll();
            panelGrafica.updateUI();
            dialog.verif = 0;
            actualizar_estad();
        }
    } else {
        JOptionPane.showMessageDialog(null,
                "Para eliminar la informacion de esta Categoria tiene que estar dentro de la misma (3x3)",
                "Ingrese en la categoria 3x3", JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:br.com.atmatech.sac.view.ViewListaAtendimento.java

private void jBexcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBexcluirActionPerformed
    // TODO add your handling code here:
    if (jTatendimento.getSelectedRow() >= 0) {
        if ((Integer) jTatendimento.getValueAt(jTatendimento.getSelectedRow(), 0) > 0) {
            if (JOptionPane.showConfirmDialog(this,
                    "Deseja Excluir o Atendimento: "
                            + jTatendimento.getValueAt(jTatendimento.getSelectedRow(), 0),
                    "Atendimento", JOptionPane.OK_CANCEL_OPTION) == 0) {
                deleteAtendimento();// w  w  w  .j ava 2s . c o m
            }
        } else {
            JOptionPane.showMessageDialog(this, "Selecione um Registro Para Excluir", "Atendimento",
                    JOptionPane.INFORMATION_MESSAGE);
        }
    }

}

From source file:domain.Excel.java

public void reporteSesionesMedicina(Table TTabla1, Integer ITipo, Date DFechaIni, Date DFechaFin,
            Animal AAnimal) {/*from ww w  .  j  a  va2s.co  m*/

        t_tabla = TTabla1;

        animal = AAnimal;
        tipo = ITipo;
        this.fecha_ini = DFechaIni;
        this.fecha_fin = DFechaFin;

        if (t_tabla.getRowCount() <= 0) {

            JOptionPane.showMessageDialog(null, "No hay datos, para exportar", gs_mensaje,
                    JOptionPane.INFORMATION_MESSAGE);
            return;
        }

        if (!showOpenFileDialog()) {
            return;
        }

        wb = new HSSFWorkbook();
        sheet = wb.createSheet("REPORTE DE SESIONES POR MEDICAMENTOS");

        styles();

        reporteSesionMedicina();

        crearExcel();
    }