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:com.mycompany.zad1.MainWindow.java

private void fourierFiltersButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fourierFiltersButtonActionPerformed
    String[] buttonsLabels = { "Low pass", "High pass", "Band pass", "Band stop", "Edge detection" };
    Filters filters = new Filters();
    boolean flag = false;
    double level = 0;

    int result = JOptionPane.showOptionDialog(null, "Choose Filter", "Choose filter",
            JOptionPane.INFORMATION_MESSAGE, 0, null, buttonsLabels, buttonsLabels[0]);

    switch (result) {
    case 0:/* w w w  .  ja va 2 s  .c o  m*/
        level = Double.parseDouble(JOptionPane.showInputDialog("D"));
        filters.lowPassFilter(imageBuff, level);
        flag = true;
        break;
    case 1:
        level = Double.parseDouble(JOptionPane.showInputDialog("D"));
        filters.HigPassFilter(imageBuff, level);
        flag = true;
        break;
    case 2:
        filters.bandPassFilter(imageBuff, 0.2, 0.6);
        flag = true;
        break;
    case 3:
        filters.bandStopFilter(imageBuff, 0.2, 0.6);
        flag = true;
        break;
    case 4:
        filters.edgeDetetcion(imageBuff, 0.2, 0.6, 30, 90);
        flag = true;
        break;
    }

    if (flag) {
        SupportFrame spectrumFrame = new SupportFrame();
        spectrumFrame.initFurier(imageBuff.getFourierMatrix(), false);

        Fourier fourier = new Fourier();
        imageBuff = fourier.fft(imageBuff, true);

        imageMoiffayLabel.setIcon(new ImageIcon(imageBuff.getImage()));
        spectrumFrame.setVisible(true);
    }
}

From source file:org.fhcrc.cpl.viewer.quant.gui.QuantitationReviewer.java

/**
 * Display a dialog box with info message
 * @param message//from   w  w  w  . j  a  va 2  s. c  om
 */
public static void infoMessage(String message) {
    JOptionPane.showMessageDialog(ApplicationContext.getFrame(), message, "Information",
            JOptionPane.INFORMATION_MESSAGE);
}

From source file:Interfaz.rubiktimer.java

private void limpiarTodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_limpiarTodoActionPerformed
    // TODO add your handling code here:
    if (verifi != 0) {
        ConsultaLimpiar dialog = new ConsultaLimpiar(new javax.swing.JFrame(), true, "TODAS LAS CATEGORIAS");
        dialog.setVisible(true);// w w w .  ja v  a 2s .c  o m
        if (dialog.verif == 1) {
            verifi = 0;
            listaT = new Lista();
            listaT2x2 = new Lista();
            listaT3x3 = new Lista();
            listaT4x4 = new Lista();
            lista5mej = new Lista();
            lista5mej2x2 = new Lista();
            lista5mej3x3 = new Lista();
            lista5mej4x4 = new Lista();
            lista10mej = new Lista();
            lista10mej2x2 = new Lista();
            lista10mej3x3 = new Lista();
            lista10mej4x4 = new Lista();
            panel2x2.removeAll();
            panel3x3.removeAll();
            panel4x4.removeAll();
            panel.removeAll();
            panel.updateUI();
            panelGrafica.removeAll();
            panelGrafica.validate();
            actualizar_estad();
            actualizarLabel();
            actualizarGrafica();
            ;
            dialog.verif = 0;
        }
    } else {
        JOptionPane.showMessageDialog(null, "Todo esta vacio", "Informacion", JOptionPane.INFORMATION_MESSAGE);
    }
}

From source file:client.ui.FilePane.java

private void authorizationButtonActionPerformed(ActionEvent evt) {//GEN-FIRST:event_authorizationButtonActionPerformed
    CloudFile selectedFile = getSelectedFile();
    if (selectedFile == null) {
        JOptionPane.showMessageDialog(this, "", "??", JOptionPane.WARNING_MESSAGE);
        return;// ww  w. j  a  va 2 s .  c o m
    }

    AuthorizationWindow authorizationWindow = new AuthorizationWindow(m_MainFrame);
    if (!authorizationWindow.isConfirmed()) {
        //fileInfoTable.clearSelection();
        return;
    }

    try {
        Authorization authorization = authorizationWindow.getAuthorization();
        AuthorizationResult result = m_Business.setAuthorization(selectedFile, authorization);
        switch (result) {
        case OK:
            JOptionPane.showMessageDialog(m_MainFrame, "?", "??",
                    JOptionPane.INFORMATION_MESSAGE);
            getDirectory(currentID);
            break;
        case unAuthorized:
            JOptionPane.showMessageDialog(m_MainFrame, "?", "??",
                    JOptionPane.WARNING_MESSAGE);
            m_MainFrame.setVisible(false);
            LoginDialog loginDialog = new LoginDialog(m_MainFrame, m_Business);
            break;
        case wrong:
            JOptionPane.showMessageDialog(m_MainFrame, "??", "??",
                    JOptionPane.WARNING_MESSAGE);
            getDirectory(currentID);
            break;
        default:
            JOptionPane.showMessageDialog(m_MainFrame, "", null, JOptionPane.ERROR_MESSAGE);
            break;
        }
    } catch (IOException e) {
        JOptionPane.showMessageDialog(m_MainFrame, "", "??", JOptionPane.ERROR_MESSAGE);
    }
}

From source file:com.ibm.soatf.gui.SOATestingFrameworkGUI.java

private void exportLog() {
    final Object[] options = { "OK" };
    try {//  w w w.j a v a 2s  . c  om
        final String fileName = "current.log";
        final String text = jtaLogging.getText();
        FileUtils.writeStringToFile(new File(fileName), text);
        JOptionPane.showOptionDialog(this, "Log exported successfully into \"" + fileName + "\"", "Success",
                JOptionPane.PLAIN_MESSAGE, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
    } catch (IOException ex) {
        JOptionPane.showOptionDialog(this, "Failed to export log. Reason:\n" + ex.getMessage(), "Failure",
                JOptionPane.PLAIN_MESSAGE, JOptionPane.ERROR_MESSAGE, null, options, options[0]);
    }
}

From source file:edu.ku.brc.specify.config.init.SpecifyDBSetupWizard.java

/**
 * //from   ww  w  .j  a v  a  2s .c  om
 */
public void configureDatabase() {
    if (wizardType == WizardType.Institution) {
        setupLoginPrefs();
    }

    if (SpecifyDBSetupWizard.this.listener != null) {
        SpecifyDBSetupWizard.this.listener.hide();
    }

    SwingWorker<Integer, Integer> worker = new SwingWorker<Integer, Integer>() {
        protected boolean isOK = false;

        /* (non-Javadoc)
         * @see javax.swing.SwingWorker#doInBackground()
         */
        @Override
        protected Integer doInBackground() throws Exception {
            try {
                String dbName = props.getProperty("dbName");
                String hostName = props.getProperty("hostName");
                DatabaseDriverInfo driverInfo = (DatabaseDriverInfo) props.get("driverObj");

                String connStr = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Create, hostName,
                        dbName);
                if (connStr == null) {
                    connStr = driverInfo.getConnectionStr(DatabaseDriverInfo.ConnectionType.Open, hostName,
                            dbName);
                }

                String saUserName = props.getProperty("saUserName"); // Master Username
                String saPassword = props.getProperty("saPassword"); // Master Password

                BuildSampleDatabase bsd = new BuildSampleDatabase();

                progressFrame = bsd.createProgressFrame(getResourceString("CREATE_DIV"));
                progressFrame.adjustProgressFrame();
                progressFrame.setProcessPercent(true);
                progressFrame.setOverall(0, 12);
                UIRegistry.pushWindow(progressFrame);

                UIHelper.centerAndShow(progressFrame);

                if (!UIHelper.tryLogin(driverInfo.getDriverClassName(), driverInfo.getDialectClassName(),
                        dbName, connStr, saUserName, saPassword)) {
                    isOK = false;
                    return null;
                }

                Session session = HibernateUtil.getCurrentSession();
                bsd.setSession(session);

                AppContextMgr ac = AppContextMgr.getInstance();
                Institution institution = ac.getClassObject(Institution.class);
                SpecifyUser user = ac.getClassObject(SpecifyUser.class);
                DisciplineType disciplineType = (DisciplineType) props.get("disciplineType");
                DataType dataType = AppContextMgr.getInstance().getClassObject(DataType.class);

                session.lock(institution, LockMode.NONE);
                session.lock(dataType, LockMode.NONE);

                bsd.setDataType(dataType);

                Division division = bsd.createEmptyDivision(institution, disciplineType, user, props, true,
                        true, true);
                if (division != null) {
                    isOK = division != null;

                    progressFrame.incOverall();

                    if (isOK) {
                        SpecifySchemaUpdateService
                                .addIPadExporterTables(DBConnection.getInstance().getConnection());
                        FixDBAfterLogin.fixUserPermissions(true);
                        saveFormatters();
                    }

                    progressFrame.setVisible(false);
                    progressFrame.dispose();
                } else {
                    isOK = false;
                }

            } catch (Exception ex) {
                //edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
                //edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSetupWizard.class, ex);
                ex.printStackTrace();
            }
            return null;
        }

        /* (non-Javadoc)
         * @see javax.swing.SwingWorker#done()
         */
        @Override
        protected void done() {
            // Create Version Record and copy if there is a connection
            if (DBConnection.getInstance().getConnection() != null) {
                String resAppVersion = UIRegistry.getAppVersion();
                String dbVersion = SchemaUpdateService.getInstance().getDBSchemaVersionFromXML();
                SpVersion.createInitialRecord(DBConnection.getInstance().getConnection(), resAppVersion,
                        dbVersion);

                if (UIRegistry.isMobile()) {
                    DBConnection.setCopiedToMachineDisk(true);
                }
            }

            JOptionPane.showMessageDialog(UIRegistry.getTopWindow(),
                    getLocalizedMessage("BLD_DONE", getResourceString(isOK ? "BLD_OK" : "BLD_NOTOK")),
                    getResourceString("COMPLETE"), JOptionPane.INFORMATION_MESSAGE);

            if (listener != null) {
                listener.hide();
                listener.finished();
            }
        }
    };
    worker.execute();
}

From source file:Interfaz.rubiktimer.java

private void cargarArchivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cargarArchivoActionPerformed
    // TODO add your handling code here:
    if (listaT.primero == null) {
        JOptionPane.showMessageDialog(null,
                "El archivo a cargar debe ser un archivo que se guardo en la Opcion (Guardar Datos Para Cargar) y no de la opcion (Guardar Datos Para Usuario), si se intenta cargar un archivo de usuario no se cargara ningun dato",
                "Informacin", JOptionPane.INFORMATION_MESSAGE);
        CargarDat ventanaVisualizar = new CargarDat();
        ventanaVisualizar.cargArchivo(listaT, lista5mej, lista10mej);
        actualizar_estad();/*from ww w.j  a v  a  2  s. c o m*/

        Lista nueva = new Lista();
        nueva = listaT;
        Nodo actual;
        actual = nueva.primero;
        while ((actual != null)) {

            JLabel nuevo_tiempo = new JLabel(actual.getDato_string());
            nuevo_tiempo.setFont(new java.awt.Font("Lucida Sans", 0, 25));
            nuevo_tiempo.setForeground(Color.yellow);
            JButton eliminar = new JButton("Eliminar Tiempo");
            eliminar.setFocusable(false);
            JButton Penalizacion = new JButton("Penalizacion +2");
            Penalizacion.setFocusable(false);
            JButton DNF = new JButton("DNF");
            DNF.setFocusable(false);
            /*if (tipoCubScramble == 0) {
            Scramble_parametro = Scramble;
            } else {
            Scramble_parametro = Scramble4x4;
            }*/
            JLabel nuevo_Scramble = new JLabel(actual.getScramble());
            nuevo_Scramble.setFont(new java.awt.Font("Lucida Sans", 0, 15));
            nuevo_Scramble.setForeground(Color.white);
            panel.add(nuevo_tiempo);
            panel.add(nuevo_Scramble);
            panel.add(eliminar);
            panel.add(Penalizacion);
            panel.add(DNF);
            panel.updateUI();

            funcionalidad_botones(nuevo_tiempo, nuevo_Scramble, eliminar, Penalizacion, DNF);

            actual = actual.enlace;
        }
        actualizarGrafica();
        System.out.println("LISTAAAAAAAAA LOOOOOOL ");
        System.out.println(listaT.primero.getDato_string());

    } else {
        JOptionPane.showMessageDialog(null, "No puede guardar en un documento una Sesion VACIA", "Sesion Vacia",
                JOptionPane.INFORMATION_MESSAGE);
    }

}

From source file:userInterface.HospitalAdminRole.ManagePatientsJPanel.java

private void saveAsPdfBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveAsPdfBtnActionPerformed
    Document document = new Document(PageSize.A4.rotate());
    String[] headers = new String[] { "Name", "TimeStamp", "Resp Rate", "Heart Rate", "Blood Pressure",
            "Temperature", "Status" };
    String filename = fileNameTxt.getText();
    try {//www . j a v a2 s  .  co  m
        if (!filename.equals("")) {
            PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(filename + ".pdf"));

            document.open();
            PdfContentByte cb = writer.getDirectContent();

            cb.saveState();
            PdfPTable table = new PdfPTable(headers.length);
            for (int i = 0; i < headers.length; i++) {
                String header = headers[i];
                PdfPCell cell = new PdfPCell();
                cell.setGrayFill(0.9f);
                cell.setPhrase(new Phrase(header.toUpperCase(), new Font(Font.HELVETICA, 8, Font.BOLD)));
                table.addCell(cell);

            }
            table.completeRow();

            table.spacingBefore();
            table.spacingAfter();
            document.add(table);
            Graphics2D g2 = cb.createGraphicsShapes(500, 500);
            //cb.showTextAligned(PdfContentByte.ALIGN_CENTER, g2, 200, 300, 0);

            Shape oldClip = g2.getClip();
            g2.clipRect(0, 0, 700, 500);

            vitalSignjTable.print(g2);
            g2.setClip(oldClip);

            g2.dispose();
            cb.restoreState();
            JOptionPane.showMessageDialog(null, "file saved", "Saved", JOptionPane.INFORMATION_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(null, "enter the filename", "FileName", JOptionPane.ERROR_MESSAGE);
        }
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:com.proyecto.vista.MantenimientoBien.java

private void btnguardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardarActionPerformed
    // TODO add your handling code here:
    String palabra = "";
    String palabra2 = "";
    if (accion == 1) {
        palabra = "registrar";
        palabra2 = "registrado";

        if (JOptionPane.showConfirmDialog(null, "Desea " + palabra + " el Bien?", "Mensaje del Sistema",
                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {

            bienControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());
            //                bienControlador.getSeleccionado().setCodigo(idField.getText());
            bienControlador.getSeleccionado().setDescripcion(descripcionField.getText().toUpperCase());
            bienControlador.getSeleccionado().setFoto(fotoField.getText());

            //                Clase clase = (Clase) cmbClase.getSelectedItem();
            //                bienControlador.getSeleccionado().setClase(clase);
            bienControlador.accion(accion);
            lista.add(bienControlador.getSeleccionado());

            if (accion == 1) {
                JOptionPane.showMessageDialog(null, "Bien " + palabra2 + " correctamente",
                        "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE);

            } else {
                JOptionPane.showMessageDialog(null, "Bien no " + palabra2, "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }/*from  ww w.j  a va 2  s .co  m*/
        } else {

            JOptionPane.showMessageDialog(null, "Bien no " + palabra2, "Mensaje del Sistema",
                    JOptionPane.ERROR_MESSAGE);
        }
    } else if (accion == 2) {
        palabra = "modificar";
        palabra2 = "modificado";

        if (JOptionPane.showConfirmDialog(null, "Desea " + palabra + " el Bien?", "Mensaje del Sistema",
                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {

            if (accion == 2) {
                JOptionPane.showMessageDialog(null, "Bien " + palabra2 + " correctamente",
                        "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE);

                lista.clear();
                bienControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());
                //                    bienControlador.getSeleccionado().setCodigo(nombreField.getText());
                bienControlador.getSeleccionado().setDescripcion(descripcionField.getText().toUpperCase());
                bienControlador.getSeleccionado().setFoto(fotoField.getText());

                //                    Clase clase = (Clase) cmbClase.getSelectedItem();
                //                    bienControlador.getSeleccionado().setClase(clase);
                bienControlador.accion(accion);
                listar();

            } else {
                JOptionPane.showMessageDialog(null, "Bien no " + palabra2, "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(null, "Bien no " + palabra2, "Mensaje del Sistema",
                    JOptionPane.ERROR_MESSAGE);
        }
    }

    for (DetalleBienCampo detalle : lista3) {
        detalle.setBien(bienControlador.getSeleccionado());
        detalleControlador.setSeleccionado(detalle);
        detalleControlador.accion(Controlador.MODIFICAR);
    }

    lista3.clear();
    FormularioUtil.activarComponente(panelOpciones, true);
    FormularioUtil.activarComponente(panelGuardar, false);
    FormularioUtil.activarComponente(panelDatos, false);
    FormularioUtil.limpiarComponente(panelDatos);
    fotoLbl.setIcon(null);
    descripcionField.setText(null);

}