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.DownloadPanel.java

public void actionReJoinFileParts() {
    List<DownloadRange> downloadRangeList = selectedDownload.getDownloadRangeList();
    List<File> files = new ArrayList<>();
    for (DownloadRange downloadRange : downloadRangeList) {
        files.add(downloadRange.getDownloadRangeFile());
    }//from   w  w  w.java2 s  . com

    FileUtil.joinDownloadedParts(files, selectedDownload.getDownloadPath(), selectedDownload.getDownloadName());
    JOptionPane.showMessageDialog(parent, "Join parts completed.", "Rejoin", JOptionPane.INFORMATION_MESSAGE);
}

From source file:com.diversityarrays.kdxplore.curate.TraitsAndInstancesPanel2.java

private void showTraitInstanceInfo(MouseEvent me) {
    Point point = me.getPoint();//from   w  ww .j av  a 2  s  .  c o  m
    int vrow = traitInstanceStatsTable.rowAtPoint(point);
    if (vrow >= 0) {
        int mrow = traitInstanceStatsTable.convertRowIndexToModel(vrow);
        if (mrow >= 0) {
            SimpleStatistics<?> stats = tiStatsModel.getStatsAt(mrow);

            TraitInstance ti = tiStatsModel.getTraitInstanceAt(mrow);
            String tiName = curationContext.getTrial().getTraitNameStyle().makeTraitInstanceName(ti);

            StringBuilder html = new StringBuilder("<HTML>");

            html.append("<dl>");
            html.append("<dt><b>Description:</b></dt>").append("<dd>")
                    .append(StringUtil.htmlEscape(ti.trait.getTraitDescription())).append("</dd>");
            html.append("<dt><b>Unit:</b></dt>").append("<dd>")
                    .append(StringUtil.htmlEscape(ti.trait.getTraitUnit())).append("</dd>");

            try {
                ValidationRule rule = ValidationRule.create(ti.trait.getTraitValRule());
                html.append("<dt><b>Validation Rule:</b></dt>").append("<dd>")
                        .append(StringUtil.htmlEscape(rule.getDescription())).append("</dd>");
            } catch (InvalidRuleException e) {
            }
            html.append("</dl>");

            html.append("<hr>");

            if (stats == null) {
                html.append("No Outliers");
            } else {
                html.append("<b>Outliers</b><br>");
                describeStats(stats, html, ti);
            }

            JOptionPane.showMessageDialog(TraitsAndInstancesPanel2.this, html.toString(),
                    "Information for  " + tiName, JOptionPane.INFORMATION_MESSAGE);

        }
    }
}

From source file:QuestionGUI.java

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

From source file:com.biosis.biosislite.vistas.inventario.MantenimientoFactura.java

private void btneliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarActionPerformed
    // TODO add your handling code here:
    accion = AbstractControlador.ELIMINAR;
    if (tblFactura.getSelectedRow() != -1) {

        Integer codigo = tblFactura.getSelectedRow();

        Factura factura = facturaControlador.buscarPorId(lista.get(codigo).getId());

        if (factura != null) {
            if (JOptionPane.showConfirmDialog(null, "Desea Eliminar el Tipo?", "Mensaje del Sistema",
                    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {

                int[] filas = tblFactura.getSelectedRows();
                for (int i = 0; i < filas.length; i++) {
                    Factura factura2 = lista.get(filas[0]);
                    lista.remove(factura2);
                    facturaControlador.setSeleccionado(factura2);
                    facturaControlador.accion(accion);
                }//  ww  w  . j a v  a 2  s  .c  o m
                if (facturaControlador.accion(accion) == 3) {
                    JOptionPane.showMessageDialog(null, "Tipo eliminado correctamente", "Mensaje del Sistema",
                            JOptionPane.INFORMATION_MESSAGE);

                } else {
                    JOptionPane.showMessageDialog(null, "Tipo no eliminada", "Mensaje del Sistema",
                            JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(null, "Tipo no eliminada", "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }
        }
    } else {
        JOptionPane.showMessageDialog(null, "Debe seleccionar un Tipo", "Mensaje del Sistema",
                JOptionPane.ERROR_MESSAGE);
    }
}

From source file:com.proyecto.vista.MantenimientoUnidadMedida.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 + " la Unidad?", "Mensaje del Sistema",
                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {

            unidadControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());
            unidadControlador.getSeleccionado().setAbreviatura(abreviaturaField.getText().toUpperCase());

            unidadControlador.accion(accion);
            lista.add(unidadControlador.getSeleccionado());

            if (accion == 1) {
                JOptionPane.showMessageDialog(null, "Unidad " + palabra2 + " correctamente",
                        "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE);
                FormularioUtil.limpiarComponente(panelDatos);
            } else {
                JOptionPane.showMessageDialog(null, "Unidad no " + palabra2, "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }/*w ww  . j av  a 2s. c o  m*/
        } else {
            FormularioUtil.limpiarComponente(panelDatos);
            JOptionPane.showMessageDialog(null, "Unidad no " + palabra2, "Mensaje del Sistema",
                    JOptionPane.ERROR_MESSAGE);
        }
    } else if (accion == 2) {
        palabra = "modificar";
        palabra2 = "modificado";

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

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

                lista.clear();

                unidadControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());
                unidadControlador.getSeleccionado().setAbreviatura(abreviaturaField.getText().toUpperCase());

                unidadControlador.accion(accion);
                listar();

                FormularioUtil.limpiarComponente(panelDatos);

            } else {
                JOptionPane.showMessageDialog(null, "Unidad no " + palabra2, "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }
        } else {
            FormularioUtil.limpiarComponente(panelDatos);
            JOptionPane.showMessageDialog(null, "Unidad no " + palabra2, "Mensaje del Sistema",
                    JOptionPane.ERROR_MESSAGE);
        }
    }

    FormularioUtil.activarComponente(panelOpciones, true);
    FormularioUtil.activarComponente(panelGuardar, false);
    FormularioUtil.activarComponente(panelDatos, false);

}

From source file:edu.ku.brc.specify.plugins.PartialDateUI.java

@Override
public void setParent(final FormViewObj parent) {
    this.parent = parent;

    JLabel lbl = parent.getLabelFor(this);
    if (lbl != null && StringUtils.isNotEmpty(dateFieldName)) {
        DBTableInfo tblInfo = DBTableIdMgr.getInstance().getByClassName(parent.getView().getClassName());
        if (tblInfo != null) {
            final DBFieldInfo fi = tblInfo.getFieldByName(dateFieldName);
            if (fi != null) {
                title = fi.getTitle();/*from  w ww  .  j a  v a 2s.  c  o m*/
                isRequired = fi.isRequired();
                if (uivs[0] instanceof ValFormattedTextFieldSingle) {
                    ((ValFormattedTextFieldSingle) uivs[0]).setRequired(isRequired);
                } else {
                    for (UIValidatable uiv : uivs) {
                        ((ValFormattedTextField) uiv).setRequired(isRequired);
                    }
                }

                if (StringUtils.isNotEmpty(fi.getTitle())) {
                    lbl.setText(fi.getTitle() + ":");
                    if (isRequired) {
                        lbl.setFont(lbl.getFont().deriveFont(Font.BOLD));
                    }
                }

                if (lbl != null) {
                    lbl.addMouseListener(new MouseAdapter() {
                        @Override
                        public void mouseClicked(MouseEvent e) {
                            super.mouseClicked(e);
                            if (e.getClickCount() == 2) {
                                JOptionPane.showMessageDialog(UIRegistry.getMostRecentWindow(),
                                        "<html>" + fi.getDescription(),
                                        UIRegistry.getResourceString("FormViewObj.UNOTES"),
                                        JOptionPane.INFORMATION_MESSAGE);
                            }
                        }
                    });
                }
            } else {
                log.error("PartialDateUI - Couldn't find date field [" + dateFieldName + "] in data obj View: "
                        + parent.getView().getName());
            }
        }
    }
}

From source file:com.heliosdecompiler.bootstrapper.Bootstrapper.java

static void displayError(Throwable t) {
    t.printStackTrace();/* w w w.j  a v a 2s  . c  om*/
    StringWriter writer = new StringWriter();
    t.printStackTrace(new PrintWriter(writer));
    JOptionPane.showMessageDialog(null, writer.toString(), t.getClass().getSimpleName(),
            JOptionPane.INFORMATION_MESSAGE);
}

From source file:userInteface.Patient.ManageVitalSignsJPanel.java

private void viewVitalSignJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewVitalSignJButtonActionPerformed
    // TODO add your handling code here:
    int selectedRow = viewVitalSignsJTable.getSelectedRow();
    if (selectedRow < 0) {
        JOptionPane.showMessageDialog(this, "Please select a row from table.", "Error",
                JOptionPane.INFORMATION_MESSAGE);
        return;/*from   w  w w  .  j a v a 2  s.  c o m*/
    }
    VitalSign vitalSign = (VitalSign) viewVitalSignsJTable.getValueAt(selectedRow, 0);
    ViewUpdateVitalSignsJPanel vuvsJPanel = new ViewUpdateVitalSignsJPanel(userProcessContainer, vitalSign,
            Boolean.FALSE);
    userProcessContainer.add("vuvsJPanel", vuvsJPanel);
    CardLayout layout = (CardLayout) userProcessContainer.getLayout();
    layout.next(userProcessContainer);
}

From source file:de.quadrillenschule.azocamsyncd.gui.ConfigurationWizardJFrame.java

private void checkConnectionjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkConnectionjButtonActionPerformed
    FTPConnection f = new FTPConnection();
    f.setPossibleConnections(gp.getProperty(CamSyncProperties.SDCARD_IPS).split(","));
    f.setFileTypes(gp.getProperty(CamSyncProperties.FILETYPES).split(","));
    boolean success = false;
    success = f.checkConnection(true).size() > 0;
    if (success) {
        JOptionPane.showMessageDialog(rootPane, "The connection to your SD card was estabilshed.", "Success!",
                JOptionPane.INFORMATION_MESSAGE);

        step1jCheckBox.setSelected(true);
        step1jCheckBox.setText("Connection OK");
        updateSelectedPanel(2);/*from w  w w .  jav a 2 s  .c o m*/
    } else {
        JOptionPane.showConfirmDialog(rootPane,
                "The connection to the WiFi SD card failed. Please check, if it is on power and the IPs are correct.",
                "Connection to SD card failed", JOptionPane.WARNING_MESSAGE);
    }
}

From source file:colectordedatos.Generador.java

private void AnadirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AnadirActionPerformed

    String serie_nue = Serie_nueva.getText();
    String nom_nuevo = Nombre_nuevo.getText();
    String entity_nuevo = Enti_nueva.getText();
    JSONObject seriesArray1 = new JSONObject();
    seriesArray1 = this.seriesArray;

    JSONObject metricMatchCriteriaTemplate;
    try {/* w  w  w  .ja v  a 2s  . co  m*/
        metricMatchCriteriaTemplate = seriesArray1.getJSONObject("metricMatchCriteriaTemplate");
        JSONObject metricExpressionTemplate = metricMatchCriteriaTemplate
                .getJSONObject("metricExpressionTemplate");
        JSONObject scopeEntity = metricExpressionTemplate.getJSONObject("scopeEntity");
        try {
            seriesArray1.put("name", serie_nue);
            metricExpressionTemplate.put("metricPath", nom_nuevo);
            scopeEntity.put("entityName", entity_nuevo);

            this.seriesArray = seriesArray1;
        } catch (JSONException ex) {
            Logger.getLogger(Generador.class.getName()).log(Level.SEVERE, null, ex);
        }
    } catch (JSONException ex) {
        Logger.getLogger(Generador.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {
        dashboard.put("widgetTemplates", arrJSON);
    } catch (JSONException ex) {
        Logger.getLogger(Generador.class.getName()).log(Level.SEVERE, null, ex);
    }
    File f;
    f = new File("C:\\Users\\Administrador\\Documents\\NetBeansProjects\\GADD\\data.json");
    FileWriter w = null;
    try {
        w = new FileWriter(f);
    } catch (IOException ex) {
        Logger.getLogger(Generador.class.getName()).log(Level.SEVERE, null, ex);
    }
    BufferedWriter bw = new BufferedWriter(w);
    PrintWriter wr = new PrintWriter(bw);
    wr.write(dashboard.toString());//escribimos en el archivo
    wr.close();
    try {
        bw.close();
    } catch (IOException ex) {
        Logger.getLogger(Generador.class.getName()).log(Level.SEVERE, null, ex);
    }

    JOptionPane.showMessageDialog(this, "los datos se han transferido con exito", "mensaje",
            JOptionPane.INFORMATION_MESSAGE);

}