List of usage examples for javax.swing JOptionPane INFORMATION_MESSAGE
int INFORMATION_MESSAGE
To view the source code for javax.swing JOptionPane INFORMATION_MESSAGE.
Click Source Link
From source file:com.biosis.biosislite.vistas.inventario.MantenimientoTipo.java
private void btnguardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardarActionPerformed // TODO add your handling code here: List<Integer> array = new ArrayList(); array.add(FormularioUtil.Validar(FormularioUtil.TipoValidacion.NUMERO, this.nombreField, "Nombre")); FormularioUtil.validar2(array);/*from w w w . jav a 2 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 Tipo?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { tipoControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase()); tipoControlador.accion(accion); lista.add(tipoControlador.getSeleccionado()); if (accion == 1) { JOptionPane.showMessageDialog(null, "Tipo " + palabra2 + " correctamente", "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE); FormularioUtil.limpiarComponente(panelDatos); } else { JOptionPane.showMessageDialog(null, "Tipo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else { FormularioUtil.limpiarComponente(panelDatos); JOptionPane.showMessageDialog(null, "Tipo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else if (accion == 2) { palabra = "modificar"; palabra2 = "modificado"; if (JOptionPane.showConfirmDialog(null, "Desea " + palabra + " el Tipo?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (accion == 2) { JOptionPane.showMessageDialog(null, "Tipo " + palabra2 + " correctamente", "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE); lista.clear(); tipoControlador.getSeleccionado().setNombre(nombreField.getText().toUpperCase()); tipoControlador.accion(accion); listar(); FormularioUtil.limpiarComponente(panelDatos); } else { JOptionPane.showMessageDialog(null, "Tipo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else { FormularioUtil.limpiarComponente(panelDatos); JOptionPane.showMessageDialog(null, "Tipo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } FormularioUtil.limpiarComponente(panelDatos); FormularioUtil.activarComponente(panelOpciones, true); FormularioUtil.activarComponente(panelGuardar, false); FormularioUtil.activarComponente(panelDatos, false); } }
From source file:com.openbravo.pos.sales.restaurant.JRetailTicketsBagRestaurantMap.java
private void showMessage(JRetailTicketsBagRestaurantMap aThis, String msg) { JOptionPane.showMessageDialog(aThis, getLabelPanel(msg), "Message", JOptionPane.INFORMATION_MESSAGE); }
From source file:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.SingleCellStatisticsController.java
/** * Get conditions according to selected rows and add them to the Analysis * Group/*w ww . ja va2 s .co m*/ */ private void addGroupToAnalysis() { List<SingleCellConditionDataHolder> conditionDataHolders = new ArrayList<>(); Boolean filteredData = singleCellAnalysisController.isFilteredData(); AnalysisPanel analysisPanel = singleCellAnalysisController.getAnalysisPanel(); int[] selectedIndices = analysisPanel.getConditionList().getSelectedIndices(); // we check here that at least two conditions have been selected to be part of the analysis group // else, the analysis does not really make sense if (selectedIndices.length > 1) { if (filteredData) { conditionDataHolders.addAll(singleCellAnalysisController.getFilteringMap().keySet()); } else { conditionDataHolders.addAll(singleCellAnalysisController.getPreProcessingMap().values()); } // make a new analysis group, with those conditions and those results SingleCellAnalysisGroup singleCellAnalysisGroup = new SingleCellAnalysisGroup(conditionDataHolders); //set name for the group if (!analysisPanel.getGroupNameTextField().getText().isEmpty()) { singleCellAnalysisGroup.setGroupName(analysisPanel.getGroupNameTextField().getText()); // set correction method to NONE by default singleCellAnalysisGroup.setCorrectionMethodName("none"); analysisPanel.getGroupNameTextField().setText(""); // actually add the group to the analysis list if (!groupsBindingList.contains(singleCellAnalysisGroup)) { groupsBindingList.add(singleCellAnalysisGroup); } } else { // ask the user to type a name for the group singleCellAnalysisController.showMessage("Please type a name for the analysis group.", "no name typed for the analysis group", JOptionPane.INFORMATION_MESSAGE); } } else { // we tell the user that statistics cannot be performed on only one condition !! // the selection is basically ignored singleCellAnalysisController.showMessage( "Sorry! It is not possible to perform analysis on one condition only!\nPlease select at least two conditions.", "at least two conditions need to be chosen for analysis", JOptionPane.WARNING_MESSAGE); } }
From source file:com.mirth.connect.manager.ManagerController.java
/** * Alerts the user with an information dialog with the passed in 'message' *///from w w w . j av a2s . c om public void alertInformationDialog(Component parent, String message) { JOptionPane.showMessageDialog(parent, message, "Information", JOptionPane.INFORMATION_MESSAGE); }
From source file:lab4.YouQuiz.java
private void initComponents() { menuBar = new JMenuBar(); menuBarFile = new JMenu(); menuBarExit = new JMenuItem(); menuBarMode = new JMenu(); menuBarEdit = new JRadioButtonMenuItem(); menuBarQuiz = new JRadioButtonMenuItem(); menuBarHelp = new JMenu(); menuBarAbout = new JMenuItem(); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setTitle("YouQuiz | Your Quiz Factory"); setIconImage((new ImageIcon(getClass().getClassLoader().getResource("resources/icon.png"))).getImage()); setMinimumSize(new Dimension(800, 500)); setResizable(false);/*w w w .jav a2s. c o m*/ menuBarFile.setText("File"); menuBarExit.setAccelerator( KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK)); menuBarExit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.exit(0); } }); menuBarExit.setText("Exit"); menuBarFile.add(menuBarExit); menuBar.add(menuBarFile); menuBarMode.setText("Mode"); menuBarEdit.setAccelerator( KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); menuBarEdit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //Execute when button is pressed System.out.println("You clicked the button"); } }); menuBarEdit.setText("Edit Mode"); menuBarQuiz.setAccelerator( KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK)); menuBarQuiz.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //Execute when button is pressed System.out.println("You clicked the button"); } }); menuBarQuiz.setSelected(true); menuBarQuiz.setText("Quiz Mode"); ButtonGroup menuBarGroup = new ButtonGroup(); menuBarGroup.add(menuBarEdit); menuBarGroup.add(menuBarQuiz); menuBarMode.add(menuBarEdit); menuBarMode.add(menuBarQuiz); menuBar.add(menuBarMode); menuBarHelp.setText("Help"); menuBarAbout.setAccelerator( KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.CTRL_MASK)); menuBarAbout.setText("About"); menuBarAbout.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { JOptionPane.showMessageDialog(null, "By Anwar Mohamed ~ 2491", "YouQuiz", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(getClass().getClassLoader().getResource("resources/icon-48.png"))); } }); menuBarHelp.add(menuBarAbout); menuBar.add(menuBarHelp); setJMenuBar(menuBar); pack(); setLocationRelativeTo(null); }
From source file:com.proyecto.vista.MantenimientoTipo.java
private void btneliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarActionPerformed // TODO add your handling code here: accion = Controlador.ELIMINAR;// w w w.ja va2s .c om if (tbltipo.getSelectedRow() != -1) { Integer codigo = tbltipo.getSelectedRow(); Tipo tipo = tipoControlador.buscarPorId(lista.get(codigo).getId()); if (tipo != null) { if (JOptionPane.showConfirmDialog(null, "Desea Eliminar el Tipo?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { int[] filas = tbltipo.getSelectedRows(); for (int i = 0; i < filas.length; i++) { Tipo empleado2 = lista.get(filas[0]); lista.remove(empleado2); tipoControlador.setSeleccionado(empleado2); tipoControlador.accion(accion); } if (tipoControlador.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:ca.sqlpower.architect.swingui.enterprise.SecurityPanel.java
private boolean promptForUnsavedChanges() { if (currentGroupOrUserEditPanel != null && (currentGroupOrUserEditPanel.hasUnsavedChanges())) { int option = JOptionPane.showConfirmDialog(getPanel(), "You have not saved all of your changes,\n" + "do you want to save them now?", "", JOptionPane.INFORMATION_MESSAGE); if (option == JOptionPane.YES_OPTION) { currentGroupOrUserEditPanel.applyChanges(); return true; }/* www .java 2 s . co m*/ if (option == JOptionPane.NO_OPTION) { return true; } if (option == JOptionPane.CANCEL_OPTION) { return false; } } return true; }
From source file:com.firmansyah.imam.sewa.kendaraan.FormUser.java
private void btnUbahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUbahActionPerformed String id = inputIdUser.getText(); String nama = inputNama.getText(); String nama_filter = nama.replaceAll(" ", "%20"); String username = inputUsername.getText(); String password = inputPassword.getText(); String password_hash = DigestUtils.md5Hex(password); System.out.println("Nama : " + nama); System.out.println("Username : " + username); System.out.println("Password : " + password); if (nama.isEmpty() || username.isEmpty()) { JOptionPane.showMessageDialog(this, "Nama dan Username Tidak Boleh Kosong", "Informasi", JOptionPane.ERROR_MESSAGE); } else if (username.contains(" ")) { JOptionPane.showMessageDialog(this, "Username Tidak Boleh Menggunakan Spasi", "Informasi", JOptionPane.ERROR_MESSAGE); } else {/* w ww .jav a2 s. c o m*/ try { String url; if (password.isEmpty()) { url = Path.serverURL + "/user/update/" + id + "/" + nama_filter + "/" + username; } else { url = Path.serverURL + "/user/update/" + id + "/" + nama_filter + "/" + username + "/" + password_hash; } getDataURL dataurl = new getDataURL(); String data = dataurl.getData(url); System.out.println(data); if (data.equals("1")) { JOptionPane.showMessageDialog(this, "Data Berhasil diubah", "Informasi", JOptionPane.INFORMATION_MESSAGE); // refresh form refreshForm(); } else { JOptionPane.showMessageDialog(this, "Data Tidak Berhasil diubah", "Informasi", JOptionPane.ERROR_MESSAGE); } } catch (IOException ex) { Logger.getLogger(FormUser.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:com.commander4j.util.JUtility.java
/** * Method exec.// www . j a v a 2 s . co m * * @param command * String * @param dir * String */ public static void exec(String command, String dir) { try { if (dir != null) { final File working = new File(dir); Runtime.getRuntime().exec(command, null, working); } else { Runtime.getRuntime().exec(command); } } catch (IOException e) { if (Common.applicationMode.equals("SwingClient")) { JOptionPane.showMessageDialog(Common.mainForm, "External application not found or configured incorrectly.\n\n" + command + "\n\nCheck the EXECUTABLE's section within Module Admin", "Information", JOptionPane.INFORMATION_MESSAGE); } } }
From source file:edu.harvard.i2b2.patientMapping.serviceClient.IMQueryClient.java
public static String sendPDOQueryRequestSOAP(String XMLstr) { try {/* w w w . j a va2 s . c o m*/ MessageUtil.getInstance().setRequest("URL: " + getValidateKeyServiceName() + "\n" + XMLstr); ServiceClient sender = AxisServiceClient.getServiceClient(); OperationClient operationClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP); // creating message context MessageContext outMsgCtx = new MessageContext(); // assigning message context's option object into instance variable Options opts = outMsgCtx.getOptions(); // setting properties into option targetEPR = new EndpointReference(UserInfoBean.getInstance().getCellDataUrl("IM")); log.debug(targetEPR); opts.setTo(targetEPR); opts.setAction("http://rpdr.partners.org/GetPatientDataObject"); opts.setTimeOutInMilliSeconds(180000); log.debug(XMLstr); SOAPEnvelope envelope = null; SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); envelope = fac.getDefaultEnvelope(); OMNamespace omNs = fac.createOMNamespace("http://rpdr.partners.org/", "rpdr"); // creating the SOAP payload OMElement method = fac.createOMElement("GetPatientDataObject", omNs); OMElement value = fac.createOMElement("RequestXmlString", omNs); value.setText(XMLstr); method.addChild(value); envelope.getBody().addChild(method); outMsgCtx.setEnvelope(envelope); operationClient.addMessageContext(outMsgCtx); operationClient.execute(true); MessageContext inMsgtCtx = operationClient.getMessageContext("In"); SOAPEnvelope responseEnv = inMsgtCtx.getEnvelope(); OMElement soapResponse = responseEnv.getBody().getFirstElement(); // log.debug("Sresponse: "+ soapResponse.toString()); OMElement soapResult = soapResponse.getFirstElement(); // log.debug("Sresult: "+ soapResult.toString()); String i2b2Response = soapResult.getText(); log.debug(i2b2Response); MessageUtil.getInstance().setResponse("URL: " + getValidateKeyServiceName() + "\n" + i2b2Response); return i2b2Response; } catch (AxisFault axisFault) { axisFault.printStackTrace(); if (axisFault.getMessage().indexOf("No route to host") >= 0) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, "Unable to make a connection to the remote server,\n this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); } else if (axisFault.getMessage().indexOf("Read timed out") >= 0) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, "Unable to obtain a response from the remote server, this is often a network error, please try again", "Network Error", JOptionPane.INFORMATION_MESSAGE); } }); } return null; } catch (Exception e) { e.printStackTrace(); return null; } }