Example usage for javax.swing JOptionPane WARNING_MESSAGE

List of usage examples for javax.swing JOptionPane WARNING_MESSAGE

Introduction

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

Prototype

int WARNING_MESSAGE

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

Click Source Link

Document

Used for warning messages.

Usage

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  ww  .j  a  va2 s  . co  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:com.tiempometa.muestradatos.JProgramTags.java

@Override
public void handleReadings(List<TagReading> readings) {
    bibLabel.setText("");
    if (readings.size() > 0) {
        if (readings.size() == 1) {
            statusLabel.setBackground(Color.cyan);
            statusLabel.setText("Leyendo tag");
            for (TagReading tagReading : readings) {
                logger.info("Tag data dump");
                logger.info(tagReading.getTagReadData().getTag().epcString());
                logger.info(String.valueOf(tagReading.getTagReadData().getData().length));
                logger.info(Hex.encodeHexString(tagReading.getTagReadData().getData()));
                logger.info(String.valueOf(tagReading.getTagReadData().getEPCMemData().length));
                logger.info(Hex.encodeHexString(tagReading.getTagReadData().getEPCMemData()));
                logger.info(String.valueOf(tagReading.getTagReadData().getTIDMemData().length));
                logger.info(Hex.encodeHexString(tagReading.getTagReadData().getTIDMemData()));
                logger.info(String.valueOf(tagReading.getTagReadData().getReservedMemData().length));
                logger.info(Hex.encodeHexString(tagReading.getTagReadData().getReservedMemData()));
                logger.info(String.valueOf(tagReading.getTagReadData().getUserMemData().length));
                logger.info(Hex.encodeHexString(tagReading.getTagReadData().getUserMemData()));
                if (tagReading.getTid() == null) {
                    try {
                        tagReading.setTid(ReaderContext.readTid(tagReading.getEpc(), 12));
                        if (logger.isDebugEnabled()) {
                            logger.debug("Got tag " + tagReading.getEpc() + " - " + tagReading.getTid());
                        }/*from  w ww.  j  av a 2  s.c  om*/
                        // try {
                        statusLabel.setBackground(Color.green);
                        statusLabel.setText("Tag leido");
                        tidTextField.setText(tagReading.getTid().toLowerCase());
                        epcTextField.setText(tagReading.getEpc().toLowerCase());
                        programmedEpcTextField.setText("");
                        // find tag by EPC/TID in database
                        logger.debug("Looking up rfid by epc " + tagReading.getEpc() + " epc char "
                                + Hex.encodeHexString(tagReading.getEpc().getBytes()));
                        Rfid rfid = totalRfidMap.get(tagReading.getEpc().toUpperCase());
                        if (rfid == null) {
                            logger.debug("Rfid string not in database tag list. Programming tag.");
                            // if in DB, warn

                            // if not then program with next chipnumber
                            programTag(tagReading);

                        } else {
                            logger.debug("Rfid string IN database tag list.");
                            Rfid batchRfid = rfidMap.get(tagReading.getEpc());
                            if (batchRfid == null) {
                                logger.debug("Rfid string IN current program batch");
                                int response = JOptionPane.showConfirmDialog(this,
                                        "Este tag tiene un cdigo que existe en el evento actual.\n"
                                                + "Corresponde al nmero " + rfid.getBib()
                                                + "\nDesea sobreescribir este tag?",
                                        "Tag ya programado", JOptionPane.YES_NO_OPTION,
                                        JOptionPane.WARNING_MESSAGE);
                                if (response == JOptionPane.YES_OPTION) {
                                    programTag(tagReading);
                                }
                            } else {
                                JOptionPane.showMessageDialog(this,
                                        "Este tag tiene un cdigo que ya ha sido programado en este lote.",
                                        "Tag ya programado", JOptionPane.ERROR_MESSAGE);
                            }
                        }

                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                        statusLabel.setBackground(Color.white);
                        statusLabel.setText("Remover tag");
                        try {
                            Thread.sleep(500);
                        } catch (InterruptedException e1) {
                            e1.printStackTrace();
                        }
                    } catch (ReaderException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                        statusLabel.setBackground(Color.red);
                        statusLabel.setText("Error");
                        try {
                            Thread.sleep(500);
                        } catch (InterruptedException e1) {
                            e1.printStackTrace();
                        }
                    }
                }
            }
        } else {
            statusLabel.setBackground(Color.orange);
            statusLabel.setText("Dos o ms tags");
        }
    } else {
        statusLabel.setBackground(Color.yellow);
        statusLabel.setText("Sin tag");

    }

}

From source file:userinterface.CyberSecurity.CyberSecurityJPanel.java

private void viewDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewDetailsButtonActionPerformed
    Organization organization = (Organization) organizationComboBox.getSelectedItem();
    UserAccountDirectory userAccountDirectory = organization.getUserAccountDirectory();

    if (null == userAccountDirectory) {
        JOptionPane.showMessageDialog(this,
                organization.getName() + " does not have employees to view details!", "No employees found",
                JOptionPane.WARNING_MESSAGE);
        return;//from  w  w w . j  a  v a 2 s .  c o m
    }

    int selectedRowIndex = employeeTable.getSelectedRow();
    if (selectedRowIndex == -1) {
        // no row selected
        JOptionPane.showMessageDialog(this, "Please select employee to view details.", "No employee selected!",
                JOptionPane.WARNING_MESSAGE);
        return;
    }

    String employeeId = getEmployeeIDFromTable(selectedRowIndex);
    UserAccount userAccount = findUserAccountByID(employeeId, userAccountDirectory);
    if (null == userAccount) {
        JOptionPane.showMessageDialog(this, "Employee details not found!", "Not found",
                JOptionPane.WARNING_MESSAGE);
        return;
    }
    initPage();
    viewEmployeeDetails(userAccount.getEmployee());
    btnLogs.setVisible(true);
}

From source file:burp.BurpExtender.java

public void warn(String message) {
    if (refreshAnimation.isRunning())
        refreshAnimation.end();/*from   ww w  .j  ava2s. com*/
    JOptionPane.showMessageDialog(getUiComponent(), message, "Warning", JOptionPane.WARNING_MESSAGE);
}

From source file:com.neu.css.view.ViewPatientDetailsJPanel.java

private void viewVitalSignButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewVitalSignButtonActionPerformed
    // TODO add your handling code here:
    int selectedRow = jTable1.getSelectedRow();
    if (selectedRow >= 0) {
        VitalSign vitalSign = (VitalSign) jTable1.getValueAt(selectedRow, 0);
        ViewVitalSignJPanel viewVitalSignJPanel = new ViewVitalSignJPanel(userProcessContainer, vitalSign);
        userProcessContainer.add("ViewVitalSignJPanel", viewVitalSignJPanel);
        CardLayout cardLayout = (CardLayout) userProcessContainer.getLayout();
        cardLayout.next(userProcessContainer);
    } else {/* w  w w. j  av a 2 s  .  c om*/
        JOptionPane.showMessageDialog(null, Consts.NO_SELECTION_VALIDATE_MESSAGE, "Warning",
                JOptionPane.WARNING_MESSAGE);
    }

}

From source file:de.juwimm.cms.content.panel.PanDocuments.java

private void btnDeleteActionPerformed(ActionEvent e) {
    try {//from   ww w .jav  a2  s .  co m
        DocumentSlimValue currDoc = null;
        String acc = bgrp.getSelection().getActionCommand();
        int rowInModel = tblDocumentsModel.getRowForDocument(Integer.valueOf(acc));
        if (rowInModel >= 0) {
            currDoc = (DocumentSlimValue) tblDocumentsModel.getValueAt(rowInModel, 4);
        }
        String tmp = acc;
        if (currDoc != null && currDoc.getDocumentName() != null
                && !"".equalsIgnoreCase(currDoc.getDocumentName())) {
            tmp += " (" + currDoc.getDocumentName() + ")";
        }
        /*
        if (currDoc != null && (currDoc.getUseCountLastVersion() + currDoc.getUseCountPublishVersion()) > 0) {
           JOptionPane.showMessageDialog(this,
          SwingMessages.getString("panel.content.documents.deleteButInUse", tmp), 
          SwingMessages.getString("panel.content.documents.deleteDocument"), 
          JOptionPane.WARNING_MESSAGE);
           return;
        }
        */
        int ret = JOptionPane.showConfirmDialog(this,
                Messages.getString("panel.content.documents.deleteThisDocument", tmp),
                Messages.getString("panel.content.documents.deleteDocument"), JOptionPane.WARNING_MESSAGE,
                JOptionPane.YES_NO_OPTION);
        if (ret == JOptionPane.YES_OPTION) {
            comm.removeDocument(Integer.valueOf(acc).intValue());
            loadThumbs(((CboModel) this.cboRegion.getSelectedItem()).getRegionId());
        }
    } catch (NullPointerException ex) {
    } catch (Exception ex) {
        if (ex.getMessage().contains("validation exception")) {
            JOptionPane.showConfirmDialog(this, rb.getString("panel.content.documents.delete.exception"),
                    rb.getString("panel.content.documents.deleteDocument"), JOptionPane.DEFAULT_OPTION,
                    JOptionPane.ERROR_MESSAGE);
        } else {
            log.warn("exception on delete document");
            if (log.isDebugEnabled()) {
                log.debug(ex);
            }
        }
    }
}

From source file:com.mirth.connect.client.ui.SettingsPanelServer.java

public void doClearAllStats() {
    String result = JOptionPane.showInputDialog(this,
            "<html>This will reset all channel statistics (including lifetime statistics) for<br>all channels (including undeployed channels).<br><font size='1'><br></font>Type CLEAR and click the OK button to continue.</html>",
            "Clear All Statistics", JOptionPane.WARNING_MESSAGE);

    if (result != null) {
        if (!result.equals("CLEAR")) {
            getFrame().alertWarning(SettingsPanelServer.this, "You must type CLEAR to clear all statistics.");
            return;
        }/*www  .j  a v  a2  s. c o  m*/

        final String workingId = getFrame().startWorking("Clearing all statistics...");

        SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {

            private Exception exception = null;

            public Void doInBackground() {
                try {
                    getFrame().mirthClient.clearAllStatistics();
                } catch (ClientException e) {
                    exception = e;
                    getFrame().alertThrowable(SettingsPanelServer.this, e);
                }
                return null;
            }

            public void done() {
                getFrame().stopWorking(workingId);

                if (exception == null) {
                    getFrame().alertInformation(SettingsPanelServer.this,
                            "All current and lifetime statistics have been cleared for all channels.");
                }
            }
        };

        worker.execute();
    }
}

From source file:org.forester.archaeopteryx.TreePanel.java

final private void blast(final PhylogenyNode node) {
    if (!isCanBlast(node)) {
        JOptionPane.showMessageDialog(this, "No sequence information present", "Cannot Blast",
                JOptionPane.WARNING_MESSAGE);
        return;//from w  w  w  .  j  a v a 2s.  c  o m
    }
    if (node.getNodeData().isHasSequence()) {
        String name = "";
        if (!ForesterUtil.isEmpty(node.getNodeData().getSequence().getName())) {
            name = node.getNodeData().getSequence().getName();
        } else if (!ForesterUtil.isEmpty(node.getNodeData().getSequence().getSymbol())) {
            name = node.getNodeData().getSequence().getSymbol();
        } else if (node.getNodeData().getSequence().getAccession() != null) {
            name = node.getNodeData().getSequence().getAccession().getValue();
        }
        if (!ForesterUtil.isEmpty(name)) {
            try {
                System.out.println("trying: " + name);
                final Blast s = new Blast();
                s.go(name);
            } catch (final Exception e) {
                e.printStackTrace();
            }
        }
    }
}

From source file:course_generator.param.frmEditCurve.java

/**
 * Delete the selected line in the points table
 *///from   ww  w . j ava  2s.  co  m
protected void DeleteLine() {
    if (!bEditMode)
        return;

    int r = TablePoints.getSelectedRow();
    if (r >= 0) {
        Object[] options = { " " + bundle.getString("frmEditCurve.DeleteYes") + " ",
                " " + bundle.getString("frmEditCurve.DeleteNo") + " " };
        int ret = JOptionPane.showOptionDialog(this, bundle.getString("frmEditCurve.DeleteLineMessage"),
                bundle.getString("frmEditCurve.DeleteLineTitle"), JOptionPane.YES_NO_OPTION,
                JOptionPane.WARNING_MESSAGE, null, options, options[1]);

        if (ret == JOptionPane.YES_OPTION) {
            param.data.remove(r);
            Collections.sort(param.data);
            RefreshView();
        }
    }
}

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

private void localStorageDirjButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localStorageDirjButton1ActionPerformed
    boolean success = false;
    JFileChooser jfc = new JFileChooser();
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    jfc.setSelectedFile(new File(gp.getProperty(CamSyncProperties.LOCALSTORAGE_PATH)));
    if (jfc.showDialog(jPanel1, "Choose as local directory") == JFileChooser.APPROVE_OPTION) {

        File f = new File(jfc.getSelectedFile().getAbsolutePath(), "azocamsynctest");
        success = f.mkdir();//w  ww  .  j a v a  2 s. co  m
        success = f.delete();
        gp.setProperty(CamSyncProperties.LOCALSTORAGE_PATH, jfc.getSelectedFile().getAbsolutePath());
    }
    if (success) {
        JOptionPane.showMessageDialog(rootPane,
                "You've setup the path for incoming files.\nAll configuration steps are performed now.\n Let's start the service!",
                "Success!", JOptionPane.INFORMATION_MESSAGE);

        step2jCheckBox.setSelected(true);
        step2jCheckBox.setText("Success");
        this.setVisible(false);
    } else {
        JOptionPane.showConfirmDialog(rootPane, "This directory cannot read &write. Please choose another one.",
                "Local storage directory not working", JOptionPane.WARNING_MESSAGE);
    }

}