Example usage for javax.swing JOptionPane showMessageDialog

List of usage examples for javax.swing JOptionPane showMessageDialog

Introduction

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

Prototype

public static void showMessageDialog(Component parentComponent, Object message) throws HeadlessException 

Source Link

Document

Brings up an information-message dialog titled "Message".

Usage

From source file:framework.classes.PoolConexion.java

/**
 * OPEN CONNECTION//  www. ja v a 2 s .co  m
 * @return 
 */
public static Connection OcuparConexion() {
    Connection conexion = null;
    try {
        conexion = dataSource.getConnection();
    } catch (SQLException e) {
        JOptionPane.showMessageDialog(null, e.toString());
    }
    return conexion;
}

From source file:evm.RegisterFingerPrint.java

private void initSensor() {
    int ret = mfs100.Init();

    if (ret != 0) {
        JOptionPane.showMessageDialog(this, "Error initializing sensor. ERR " + ret);
        this.setVisible(false);
    }/*ww w.  j  a  va 2  s.c  om*/
}

From source file:controller.model.ControllerPsUsuarios.java

public PsUsuarios crearUsuarios(String[] argsUsuario) {
    controllerFecha = new ControllerFecha();
    PsUsuarios psUsuarios;//from   w  w w. j a  v a  2s. c om

    if (!argsUsuario[0].equals("") && !argsUsuario[1].equals("") && !argsUsuario[2].equals("")
            && !argsUsuario[3].equals("") && !argsUsuario[4].equals("") && !argsUsuario[5].equals("")) {
        if (argsUsuario[3].length() >= 5) {

            psUsuarios = new PsUsuarios();
            psUsuarios.setNombres(argsUsuario[0]);
            psUsuarios.setApellidos(argsUsuario[1]);
            psUsuarios.setUsuario(argsUsuario[2]);
            psUsuarios.setPassword(DigestUtils.sha1Hex(argsUsuario[3]));
            psUsuarios.setEmpresa(argsUsuario[4]);
            psUsuarios.setRol(argsUsuario[5]);
            psUsuarios.setFechaCreacion(controllerFecha.getFecha());
            psUsuarios.setFechaModificacion(controllerFecha.getFecha());

            return psUsuarios;
        }
        JOptionPane.showMessageDialog(null, "La contrasea debe tener como minimo 5 caracteres");

    } else {
        JOptionPane.showMessageDialog(null, "Por favor complete todos los campos");
        return null;
    }
    return null;
}

From source file:gephi.spade.panel.FCSOperations.java

public FCSOperations(fcsFile inputFile) throws FileNotFoundException, IOException {
    fcsInputFile = inputFile;// www .ja v a 2s. c  o m
    JOptionPane.showMessageDialog(null, "line 38");
    eventsInitl = new Array2DRowRealMatrix(fcsInputFile.getCompensatedEventList());
    JOptionPane.showMessageDialog(null, "line 40");
}

From source file:ca.sqlpower.wabit.swingui.action.DeleteWabitServerWorkspaceAction.java

public void actionPerformed(ActionEvent e) {
    try {/*from w  w w  . ja  va 2s .co m*/
        WabitSwingSessionImpl activeSwingSession = (WabitSwingSessionImpl) context.getActiveSwingSession();
        if (activeSwingSession == null) {
            JOptionPane.showMessageDialog(context.getFrame(), "That button refreshes the current workspace,\n"
                    + "but there is no workspace selected right now.");
            return;
        }
        int choice = JOptionPane.showConfirmDialog(context.getFrame(),
                "By deleting this workspace, " + "you will not be able to recover any of its contents.\n"
                        + "Are you sure you want to delete it?",
                "Are you sure?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);

        if (choice == JOptionPane.YES_OPTION) {
            activeSwingSession.delete();
        }
    } catch (ClientProtocolException ex) {
        throw new RuntimeException(ex);
    } catch (URISyntaxException ex) {
        throw new RuntimeException(ex);
    } catch (IOException ex) {
        throw new RuntimeException(ex);
    }
}

From source file:UserInterface.SupplierRole.ProductReportJPanel.java

/**
 * Creates new form ReviewProductPerformance
 *//*from   w  w w.  j  av  a  2  s . c om*/
public ProductReportJPanel(JPanel userProcessContainer, Supplier supplier) {
    initComponents();
    this.userProcessContainer = userProcessContainer;
    this.supplier = supplier;
    supplierName.setText(supplier.getName() + "-- Sales Performance");
    try {
        Product product = supplier.getProductsSorted(supplier);
        productName.setText(product.getProdName());
        quanitytxt.setText(String.valueOf(product.getSoldQuantity()));
        populateProducts();
    } catch (IndexOutOfBoundsException ai) {
        errorMsg.setText("Sales Report Not Generated...!!!");
        JOptionPane.showMessageDialog(null,
                "The Sales Report will only be generated after the customer's checkout");
    }
}

From source file:Model.OpMenu.java

public void Cadastro_Item(Item item) {
    it.LeArquivo();/*from ww  w .  jav  a  2s . c o m*/
    if (it.BuscaItem(item.getArtigo()) == null) {
        it.Add(item);
        Estoque estoque = new Estoque();
        estoque.setItem(item.artigo);
        estoque.setQuantidade(0);
        estoque.setQuant(0);
        te.Add(estoque, false);
        te.SalvaArquivo(estoque);
        it.SalvaArquivo(item);
        JOptionPane.showMessageDialog(null, "Item Cadastrado com sucesso");
    } else
        JOptionPane.showMessageDialog(null, "Item ja cadastrado");
}

From source file:User.Interface.SupplierAdminRole.ReviewSalesJPanel.java

private void displayData() {
    try {//from  w w  w.  j  a va  2  s  .  co  m

        //check if supplier has products
        if (supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList().size() < 1) {
            JOptionPane.showMessageDialog(this, "No products avaiailable from supplier");
            return;
        }

        int rowCount = productjTable.getRowCount();
        DefaultTableModel model = (DefaultTableModel) productjTable.getModel();
        for (int i = rowCount - 1; i >= 0; i--) {
            model.removeRow(i);
        }

        double totalSaleAmt = 0;
        int topSoldProductID = 1;

        for (MedicalDevice md : supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList()) {
            Object row[] = new Object[4];
            row[0] = md;
            row[1] = md.getDeviceId();
            row[2] = md.getSoldQuantity();
            double totalProductSale = (md.getPrice() * md.getSoldQuantity());
            row[3] = totalProductSale;
            model.addRow(row);

            totalSaleAmt = totalSaleAmt + totalProductSale;
            if (md.getSoldQuantity() > supplierAdminOrganization.getMedicalDeviceCatalog()
                    .getMedicalDeviceList().get(topSoldProductID - 1).getSoldQuantity()) {
                topSoldProductID = md.getDeviceId();
            }
        }

        if (totalSaleAmt > 0) {
            topSoldjTextField.setText(supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList()
                    .get(topSoldProductID - 1).getDeviceName());
            totalSalejTextField.setText(String.valueOf(totalSaleAmt));
        } else {
            topSoldjTextField.setText("None");
            totalSalejTextField.setText("0");
        }

    } catch (Exception e) {
        JOptionPane.showMessageDialog(this, "An error occurred");
    }
}

From source file:framework.clss.ConnectionBD.java

public static void liberaConexion(Connection conexion) {
    try {/*from ww  w  . jav  a 2s . c o  m*/
        if (null != conexion)
            conexion.close();
    } catch (SQLException e) {
        JOptionPane.showMessageDialog(null, e.toString());
    }
}

From source file:classes.connectionPool.java

public static void connectionRelease(Connection conexion) {
    try {/*from   www .  j a  v a2 s.  c  om*/
        if (null != conexion)
            // En realidad no cierra, solo libera la conexion.
            conexion.close();
    } catch (SQLException e) {
        JOptionPane.showMessageDialog(null, e.toString());
    }
}