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.proyecto.vista.MantenimientoEmpleado.java

private void btneliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarActionPerformed
    // TODO add your handling code here:
    accion = Controlador.ELIMINAR;/*from w  ww  .j  a  v a  2s . co  m*/
    if (tblempleado.getSelectedRow() != -1) {

        Integer codigo = tblempleado.getSelectedRow();

        Empleado empleado = empleadoControlador.buscarPorId(lista.get(codigo).getDni());

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

                int[] filas = tblempleado.getSelectedRows();
                for (int i = 0; i < filas.length; i++) {
                    Empleado empleado2 = lista.get(filas[0]);
                    lista.remove(empleado2);
                    empleadoControlador.setSeleccionado(empleado2);
                    empleadoControlador.accion(accion);
                }
                if (empleadoControlador.accion(accion) == 3) {
                    JOptionPane.showMessageDialog(null, "Empleado eliminado correctamente",
                            "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE);

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

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

private void jbtCheckInActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jbtCheckInActionPerformed
    if (this.jbtCheckIn.isVisible()) {
        final int confirmation = ViewUtils.showConfirmDialog(this, ViewUtils.MSG_SAVE_QUESTION,
                ViewUtils.TITLE_SAVED);/* w  w w . j  a  va  2 s . c  o  m*/
        if (confirmation == JOptionPane.OK_OPTION) {
            final RoomStatus roomStatusCheckIn = roomStatusController.selectDisabled();
            this.invoice.setUpdated(new Date());
            this.invoice.setRoomStatus(roomStatusCheckIn);
            this.invoiceController.save(invoice);
            ViewUtils.showMessage(this, ViewUtils.MSG_SAVED, ViewUtils.TITLE_SAVED,
                    JOptionPane.INFORMATION_MESSAGE);
            this.parent.refreshRoomData();
            this.setVisible(false);
        }
    }
}

From source file:dialog.DialogFunctionRoom.java

private void actionAddNoController() {
    String roomName = tfRoomName.getText();
    if (roomName.isEmpty()) {
        JOptionPane.showMessageDialog(null, "Tn phng khng c  trng", "Error",
                JOptionPane.ERROR_MESSAGE);
        tfRoomName.requestFocus();/*  ww w  .  ja  v  a 2  s. c o  m*/
        return;
    }
    String priceString = tfPrice.getText();
    if (priceString.isEmpty()) {
        JOptionPane.showMessageDialog(null, "Gi phng khng c  trng", "Error",
                JOptionPane.ERROR_MESSAGE);
        tfPrice.requestFocus();
        return;
    }
    double price;
    try {
        price = Double.parseDouble(priceString);
    } catch (NumberFormatException nfe) {
        JOptionPane.showMessageDialog(null, "Gi phng khng ng nh dng", "Error",
                JOptionPane.ERROR_MESSAGE);
        return;
    }
    int max;
    try {
        max = Integer.parseInt(priceString);
    } catch (NumberFormatException nfe) {
        JOptionPane.showMessageDialog(null, "Gi phng khng ng nh dng", "Error",
                JOptionPane.ERROR_MESSAGE);
        return;
    }

    Floor objFloor = (Floor) cbFloor.getSelectedItem();
    int roomType = cbRoomType.getSelectedIndex() + 1;
    ModelPicture modelPicture = new ModelPicture();
    String idRoom = UUID.randomUUID().toString();
    if (!(new ModelRoom()).isExistRoomInFloor(roomName, objFloor.getIdFloor())) {
        mListUriPhotos.stream().forEach((uriPicture) -> {
            File file = new File(uriPicture);
            String fileName = FilenameUtils.getBaseName(file.getName()) + "-" + System.nanoTime() + "."
                    + FilenameUtils.getExtension(file.getName());
            Path source = Paths.get(uriPicture);
            Path destination = Paths.get("files/" + fileName);
            try {
                Files.copy(source, destination, StandardCopyOption.REPLACE_EXISTING);
            } catch (IOException ex) {
                Logger.getLogger(DialogFunctionRoom.class.getName()).log(Level.SEVERE, null, ex);
            }
            Picture objPicture = new Picture(UUID.randomUUID().toString(), idRoom, fileName);
            modelPicture.addItem(objPicture);
            mListPictures.add(objPicture);
        });
        Room objRoom = new Room(idRoom, objFloor.getIdFloor(), roomName, roomType, price,
                Constant.ROOM_CONDITION_AVAILABLE_TYPE, mListPictures, null, objFloor.getFloorName(), max);
        mObjRoom = objRoom;
        if (new ModelRoom().addItem(objRoom)) {
            objFloor.setMaxRoom(objFloor.getMaxRoom() + 1);
            new ModelFloor().editItem(objFloor);
            ImageIcon icon = new ImageIcon(getClass().getResource("/images/ic_success.png").getPath());
            JOptionPane.showMessageDialog(this, "Thm thnh cng!", "Success",
                    JOptionPane.INFORMATION_MESSAGE, icon);
            this.dispose();
        }
    } else {
        JOptionPane.showMessageDialog(this, "Phng  tn ti!", "Error", JOptionPane.ERROR_MESSAGE);
    }
}

From source file:net.chaosserver.timelord.swingui.Timelord.java

/**
 * Shows the about dialog that tells about the application.
 *//*from  www . j a  v  a  2s . com*/
public void showAboutDialog() {
    Package packageInfo = Package.getPackage("net.chaosserver.timelord.swingui");

    if (log.isTraceEnabled()) {
        if (packageInfo != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(packageInfo.getClass().getName());
            sb.append(" [name=");
            sb.append(packageInfo.getName());
            sb.append(", specificationTitle=");
            sb.append(packageInfo.getSpecificationTitle());
            sb.append(", specificationVersion=");
            sb.append(packageInfo.getSpecificationVersion());
            sb.append(", specificationVendor=");
            sb.append(packageInfo.getSpecificationVendor());
            sb.append(", implementationTitle=");
            sb.append(packageInfo.getImplementationTitle());
            sb.append(", implementationVersion=");
            sb.append(packageInfo.getImplementationVersion());
            sb.append(", implementationVendor=");
            sb.append(packageInfo.getImplementationVendor());
            sb.append("]");
            log.trace(sb.toString());
        }
    }

    StringBuffer sb = new StringBuffer();
    sb.append("Timelord");

    if ((packageInfo != null) && (packageInfo.getImplementationVersion() != null)) {
        sb.append(" [");
        sb.append(packageInfo.getImplementationVersion());
        sb.append("]");
    } else {
        Properties appProperties = getAppProperties();
        if (appProperties != null) {
            sb.append(" ");
            sb.append(appProperties.getProperty("implementation.version", "[Unknown Version]"));
        } else {
            sb.append(" [Unknown Version]");
        }
    }

    sb.append("\n");
    sb.append(resourceBundle.getString(RROOT + ".about"));

    JOptionPane.showMessageDialog(applicationFrame, sb.toString(), "About Timelord",
            JOptionPane.INFORMATION_MESSAGE, applicationIcon);
}

From source file:domain.Excel.java

public void reporteSesionesPeso(Table TTabla1, Integer ITipo, Date DFechaIni, Date DFechaFin, Animal AAnimal) {

        t_tabla = TTabla1;/*from   w ww. j ava  2  s.  co  m*/

        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 PESO");

        styles();

        reporteSesionPeso();

        crearExcel();
    }

From source file:com.diversityarrays.kdxplore.field.FieldViewDialog.java

private void showTrialInfo(Trial trial, Component component) {

    List<Trait> traits = new ArrayList<>(traitMap.values());
    Collections.sort(traits);/* w w  w.  j a v  a 2  s  .c  o m*/

    StringBuilder html = new StringBuilder("<HTML>");
    html.append("Trial has samples for ").append(countsByTraitId.size()).append(" Traits:");

    html.append("<UL>");
    for (Trait trait : traits) {
        SampleCounts counts = countsByTraitId.get(trait.getTraitId());
        if (counts != null) {
            html.append("<LI>").append(StringUtil.htmlEscape(String.format("%20s: ", trait.getTraitName())))
                    .append(counts.scored).append(" / ").append(counts.scored + counts.unscored)
                    .append("</LI>");
        }
    }
    html.append("</UL>");

    JOptionPane.showMessageDialog(component, new JLabel(html.toString()), trial.getTrialName(),
            JOptionPane.INFORMATION_MESSAGE);
}

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

private void btnguardar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardar1ActionPerformed
    // TODO add your handling code here:
    List<Integer> array = new ArrayList();
    array.add(FormularioUtil.Validar(FormularioUtil.TipoValidacion.NUMERO, this.nombreField, "Nombre"));
    array.add(FormularioUtil.Validar(FormularioUtil.TipoValidacion.NUMERO, this.empleadoField, "Responsable"));

    FormularioUtil.validar2(array);/*from w  w w.  ja  v a2  s  .c om*/

    if (FormularioUtil.error) {
        JOptionPane.showMessageDialog(null, FormularioUtil.mensaje, "Mensaje del Sistema",
                JOptionPane.ERROR_MESSAGE);
        FormularioUtil.mensaje = "";
        FormularioUtil.error = false;
    } else {
        String palabra = "";
        String palabra2 = "";
        if (accion == 1) {
            palabra = "registrar";
            palabra2 = "registrado";

            if (JOptionPane.showConfirmDialog(null, "Desea " + palabra + " el Ambiente?",
                    "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                ambienteControlador.getSeleccionado().setCodigo(idField.getText().toUpperCase());
                ambienteControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());

                Area area = (Area) cmbArea.getSelectedItem();
                ambienteControlador.getSeleccionado().setArea(area);

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

                if (accion == 1) {
                    JOptionPane.showMessageDialog(null, "Ambiente " + palabra2 + " correctamente",
                            "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE);
                    FormularioUtil.limpiarComponente(panelDatos);
                } else {
                    JOptionPane.showMessageDialog(null, "Ambiente no " + palabra2, "Mensaje del Sistema",
                            JOptionPane.ERROR_MESSAGE);
                }
            } else {
                FormularioUtil.limpiarComponente(panelDatos);
                JOptionPane.showMessageDialog(null, "Ambiente no " + palabra2, "Mensaje del Sistema",
                        JOptionPane.ERROR_MESSAGE);
            }
        } else if (accion == 2) {
            palabra = "modificar";
            palabra2 = "modificado";

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

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

                    lista.clear();
                    ambienteControlador.getSeleccionado().setCodigo(idField.getText().toUpperCase());
                    ambienteControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase());
                    Area area = (Area) cmbArea.getSelectedItem();
                    ambienteControlador.getSeleccionado().setArea(area);

                    ambienteControlador.accion(accion);
                    listar();

                    FormularioUtil.limpiarComponente(panelDatos);

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

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

From source file:userInteface.Patient.ManageVitalSignsJPanel.java

private void showChartJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showChartJButtonActionPerformed
    // TODO add your handling code here:
    int selectedRow = viewPatientsJTable.getSelectedRow();
    if (selectedRow < 0) {
        JOptionPane.showMessageDialog(this, "Please select a patient from table.", "Error",
                JOptionPane.INFORMATION_MESSAGE);
        return;/*from   w w w .  j av  a2s . co m*/
    }
    createChart();
}

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

private void jbtDeleteActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jbtDeleteActionPerformed
    if (this.jbtDelete.isVisible()) {
        final int confirmation = ViewUtils.showConfirmDialog(this, ViewUtils.MSG_DELETE_QUESTION,
                ViewUtils.TITLE_SAVED);// w w w.  j  a  v a  2 s .  c  o  m
        if (confirmation == JOptionPane.OK_OPTION) {
            final RoomStatus roomStatusEnabled = roomStatusController.selectEnabled();
            final InvoiceStatus invoiceStatusDeleted = invoiceStatusController.selectDeleted();
            this.invoice.setEnabled(false);
            this.invoice.setUpdated(new Date());
            this.invoice.setRoomStatus(roomStatusEnabled);
            this.invoice.setInvoiceStatus(invoiceStatusDeleted);
            this.invoiceController.save(invoice);
            ViewUtils.showMessage(this, ViewUtils.MSG_DELETED, ViewUtils.TITLE_SAVED,
                    JOptionPane.INFORMATION_MESSAGE);
            this.parent.refreshRoomData();
            this.setVisible(false);
        }
    }
}

From source file:UserInterface.GarbageCollectorRole.GarbageCollectorWorkAreaJPanel.java

private void jSendToMTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSendToMTActionPerformed
    int selectedRow = jGarbageCollector.getSelectedRow();
    GarbageCollectorWorkRequest gcwr = (GarbageCollectorWorkRequest) jGarbageCollector.getValueAt(selectedRow,
            0);/*  w w w.j  av a  2  s .  c om*/
    if (gcwr.getMessage().equalsIgnoreCase("Allocated")) {
        JOptionPane.showMessageDialog(null, "Already Assigned");
        return;

    }
    int metalCollected;
    int metalSegregated;
    String message = jMessageToMD.getText();

    if (message.trim().length() == 0) {
        JOptionPane.showMessageDialog(null, "MessageToMD cannot be null");
        return;

    }
    try {
        metalCollected = Integer.parseInt(jMetalCollected.getText().trim());
    } catch (NumberFormatException e) {
        JOptionPane.showMessageDialog(null, "Enter correct Metal Collected  value in Kgs", "Information",
                JOptionPane.INFORMATION_MESSAGE);
        return;
    }
    try {
        metalSegregated = Integer.parseInt(jMetalSegregated.getText().trim());
    } catch (NumberFormatException e) {
        JOptionPane.showMessageDialog(null, "Enter correct Metal Segregated value in Kgs", "Information",
                JOptionPane.INFORMATION_MESSAGE);
        return;
    }

    if (metalCollected < metalSegregated) {

        JOptionPane.showMessageDialog(null, "Collected metal value cannot be less than Segregated value",
                "Information", JOptionPane.INFORMATION_MESSAGE);
        return;

    }
    if (metalCollected <= 0 || metalSegregated < 0) {

        JOptionPane.showMessageDialog(null, "Incorrect Metal values", "Information",
                JOptionPane.INFORMATION_MESSAGE);
        return;

    }
    if (selectedRow < 0) {
        JOptionPane.showMessageDialog(null, "Please select a row");
        return;
    }

    UserAccount ua = (UserAccount) jMetalTransportation.getSelectedItem();

    if (ua.equals("")) {
        JOptionPane.showMessageDialog(null, "Please select a Metal Transporter");
        return;
    }

    if (jMetalCollected.equals("") || jMetalSegregated.equals("")) {
        JOptionPane.showMessageDialog(null, "Please insert metal garbage details");
        return;

    }

    gcwr.setSentToMD(ua);
    gcwr.setMessage("Allocated");
    gcwr.setStatus("Sent");
    gcwr.setCollectedMetal(metalCollected);
    gcwr.setSegregatedMetal(metalSegregated);
    gcwr.setMessageToMetalDept(message);
    gcwr.setReceiver(userAccount);
    gcwr.setType("Done");
    //        gcwr.setCollectedDegradable(0);
    //        gcwr.setCollectedPlastic(0);
    //        gcwr.setMessageToBioDept("");
    //        gcwr.setMessageToPlasticDept("");
    //        gcwr.setSegregatedDegradable(0);
    //        gcwr.setSegregatedPlastic(0);
    MetalTransportationWorkRequest request = new MetalTransportationWorkRequest();
    request.setMessage("To be Transported");
    request.setMessageToMetalDept(message);
    request.setCollectedMetal(metalCollected);
    request.setSegregatedMetal(metalSegregated);
    request.setReceiver(gcwr.getSentToMD());
    request.setRequestDate(gcwr.getRequestDate());

    Organization org = null;
    for (Organization organization : enterprise.getOrganizationDirectory().getOrganizationList()) {
        if (organization instanceof MetalTransportationOrganization) {
            org = organization;
            break;
        }
    }
    if (org != null) {

        ua.getWorkQueue().getWorkRequestList().add(request);

        JOptionPane.showMessageDialog(null, "Work request added.");

    }

    refresh();

}