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: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 a2 s. c o 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); } }
From source file:userInteface.Patient.ManageVitalSignsJPanel.java
private void addVitalSignsJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addVitalSignsJButtonActionPerformed // TODO add your handling code here: int selectedRow = viewPatientsJTable.getSelectedRow(); if (selectedRow < 0) { JOptionPane.showMessageDialog(this, "Please select a row from table.", "Error", JOptionPane.INFORMATION_MESSAGE); return;//from ww w . ja v a 2 s .c o m } Person person = (Person) viewPatientsJTable.getValueAt(selectedRow, 0); Patient patient = person.getPatient(); if (patient != null) { CreateVitalSignJPanel cvsJPanel = new CreateVitalSignJPanel(userProcessContainer, patient); userProcessContainer.add("cvsJPanel", cvsJPanel); CardLayout layout = (CardLayout) userProcessContainer.getLayout(); layout.next(userProcessContainer); } else { JOptionPane.showMessageDialog(this, "Patient not created, Please create Patient first.", "Error", JOptionPane.ERROR_MESSAGE); } }
From source file:com.proyecto.vista.MantenimientoProveedor.java
private void btneliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarActionPerformed // TODO add your handling code here: accion = Controlador.ELIMINAR;//from w w w . ja va2s . c o m if (tblProveedor.getSelectedRow() != -1) { Integer codigo = tblProveedor.getSelectedRow(); Proveedor proveedor = lista.get(codigo); if (proveedor != null) { if (JOptionPane.showConfirmDialog(null, "Desea Eliminar el Proveedor?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { int[] filas = tblProveedor.getSelectedRows(); for (int i = 0; i < filas.length; i++) { Proveedor empleado2 = lista.get(filas[0]); lista.remove(empleado2); proveedorControlador.setSeleccionado(empleado2); proveedorControlador.accion(accion); } if (proveedorControlador.accion(accion) == 3) { JOptionPane.showMessageDialog(null, "Proveedor eliminado correctamente", "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(null, "Proveedor no eliminado", "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(null, "Proveedor no eliminado", "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } } else { JOptionPane.showMessageDialog(null, "Debe seleccionar un Empleado", "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } }
From source file:userinterface.HealthAnalystRole.ViewReportJPanel.java
private void createChart() { DefaultCategoryDataset healthDataset = new DefaultCategoryDataset(); int selectedRow = tblHealthTable.getSelectedRow(); Device effects = (Device) tblHealthTable.getValueAt(selectedRow, 0); //Device device= device.getEffectsOnBodyList().getEffectsOnBodyList().; for (Device d : organization.getDeviceDirectory().getDeviceList()) { if (d.getEffectsOnBodyList().getEffectsOnBodyList().isEmpty() || d.getEffectsOnBodyList().getEffectsOnBodyList().size() == 1) { JOptionPane.showMessageDialog(this, "No body organs or only one body organ affected found. At least 2 organs effected records needed to show chart!", "Warning", JOptionPane.INFORMATION_MESSAGE); return; } else {/* ww w . j a v a 2 s . com*/ Double organ = Double.parseDouble(txtOrgan.getText()); Double value = d.getMaxSAR(); } } //ArrayList<EffectsOnBody> effectsOnBodyList = device.getEffectsOnBodyList().getEffectsOnBodyList(); /*if (effectsOnBodyList.isEmpty() || effectsOnBodyList.size() == 1) { JOptionPane.showMessageDialog(this, "No body organs or only one body organ affected found. At least 2 organs effected records needed to show chart!", "Warning", JOptionPane.INFORMATION_MESSAGE); return; }*/ Double organ = Double.parseDouble(txtOrgan.getText()); for (Device device : organization.getDeviceDirectory().getDeviceList()) { for (EffectsOnBody b1 : device.getEffectsOnBodyList().getEffectsOnBodyList()) { Double value = device.getMaxSAR(); //healthDataset.addValue(vitalSign.getHeartRate(),"Most Likely Diseases", device.getMaxSAR()); //vitalSignDataset.addValue(vitalSign.getBloodPressure(),"BP", vitalSign.getTimestamp()); //vitalSignDataset.addValue(vitalSign.getWeight(),"WT", vitalSign.getTimestamp()); } } JFreeChart healthSignChart = ChartFactory.createBarChart3D("Effects On Health Chart", "Time Stamp", "Rate", healthDataset, PlotOrientation.VERTICAL, true, false, false); healthSignChart.setBackgroundPaint(Color.white); CategoryPlot vitalSignChartPlot = healthSignChart.getCategoryPlot(); vitalSignChartPlot.setBackgroundPaint(Color.lightGray); CategoryAxis vitalSignDomainAxis = vitalSignChartPlot.getDomainAxis(); vitalSignDomainAxis .setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); NumberAxis vitalSignRangeAxis = (NumberAxis) vitalSignChartPlot.getRangeAxis(); vitalSignRangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); ChartFrame chartFrame = new ChartFrame("Chart", healthSignChart); chartFrame.setVisible(true); chartFrame.setSize(500, 500); }
From source file:edu.ku.brc.specify.config.init.SpecifyDBSetupWizard.java
/** * @param wizardType/*w ww . j a v a 2 s .c o m*/ * @param listener */ public SpecifyDBSetupWizard(final WizardType wizardType, final WizardListener listener) { super(); this.wizardType = wizardType; this.listener = listener; System.setProperty(DBMSUserMgr.factoryName, "edu.ku.brc.dbsupport.MySQLDMBSUserMgr"); /*setupXMLPath = UIRegistry.getUserHomeAppDir() + File.separator + "setup_prefs.xml"; try { props.loadFromXML(new FileInputStream(new File(setupXMLPath))); } catch (Exception ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSetupWizard.class, ex); }*/ HelpMgr.setLoadingPage("Load"); cardPanel = new JPanel(cardLayout); cancelBtn = createButton(UIRegistry.getResourceString("CANCEL")); helpBtn = createButton(UIRegistry.getResourceString("HELP")); JPanel btnBar; backBtn = createButton(UIRegistry.getResourceString("BACK")); nextBtn = createButton(UIRegistry.getResourceString("NEXT")); CellConstraints cc = new CellConstraints(); PanelBuilder bbpb = new PanelBuilder(new FormLayout("f:p:g,p,4px,p,4px,p,4px,p,4px", "p")); bbpb.add(helpBtn, cc.xy(2, 1)); bbpb.add(backBtn, cc.xy(4, 1)); bbpb.add(nextBtn, cc.xy(6, 1)); bbpb.add(cancelBtn, cc.xy(8, 1)); btnBar = bbpb.getPanel(); boolean doTesting = AppPreferences.getLocalPrefs().getBoolean("wizard.defaults", false); if (doTesting && wizardType == WizardType.Institution) { props.put("hostName", "localhost"); props.put("dbName", "testfish"); props.put("dbUserName", "Specify"); props.put("dbPassword", "Specify"); props.put("saUserName", "Master"); props.put("saPassword", "Master"); props.put("firstName", "Test"); props.put("lastName", "User"); props.put("middleInitial", "a"); props.put("email", "tester@ku.edu"); props.put("usrUsername", "testuser"); props.put("usrPassword", "testuser"); props.put("instName", "KU natural History Museum"); props.put("instAbbrev", "KU-NHM"); props.put("divName", "Fish"); props.put("divAbbrev", "IT"); props.put("collName", "Fish"); props.put("collPrefix", "KUFSH"); // Address props.put("addr1", "1345 Jayhawk Blvd"); props.put("addr2", "606 Dyche Hall"); props.put("city", "Lawrence"); props.put("state", "KS"); props.put("country", "USA"); props.put("zip", "66044"); props.put("phone", "785-864-5555"); props.put("addtaxon", true); } else { props.put("hostName", "localhost"); props.put("dbName", "specify"); } props.put("userType", SpecifyUserTypes.UserType.Manager.toString()); UIFieldFormatterMgr.setDoingLocal(true); String accessionFmt = null; if (wizardType == WizardType.Institution) { props.put("fromwizard", "true"); dbPanel = new DatabasePanel(nextBtn, backBtn, getHelpCntxt("wizard_mysql_username"), true); panels.add(dbPanel); HelpMgr.registerComponent(helpBtn, dbPanel.getHelpContext()); if (listener != null) { listener.helpContextChanged(dbPanel.getHelpContext()); } panels.add(new MasterUserPanel("SA", "ENTER_SA_INFO", getHelpCntxt("wizard_master_username"), new String[] { "SA_USERNAME", "SA_PASSWORD" }, new String[] { "saUserName", "saPassword" }, new Integer[] { 32, 32 }, nextBtn, backBtn, true)); panels.add(new GenericFormPanel("SECURITY", "SECURITY_INFO", getHelpCntxt("wizard_security_on"), new String[] { "SECURITY_ON" }, new String[] { "security_on" }, new String[] { "checkbox" }, nextBtn, backBtn, true)); userInfoPanel = new UserInfoPanel("AGENT", "ENTER_COLMGR_INFO", getHelpCntxt("wizard_create_it_user"), new String[] { "FIRSTNAME", "LASTNAME", "MIDNAME", "EMAIL", null, "USERLOGININFO", "USERNAME", "PASSWORD" }, new String[] { "firstName", "lastName", "middleInitial", "email", " ", "-", "usrUsername", "usrPassword" }, new boolean[] { true, true, false, true, true, false, true, true }, new Integer[] { 50, 120, 50, 50, null, null, 64, 32 }, nextBtn, backBtn); panels.add(userInfoPanel); panels.add(new GenericFormPanel("INST", "ENTER_INST_INFO", getHelpCntxt("wizard_create_institution"), new String[] { "NAME", "ABBREV", null, "INST_ADDR", "ADDR1", "ADDR2", "CITY", "STATE", "COUNTRY", "ZIP", "PHONE" }, new String[] { "instName", "instAbbrev", " ", "-", "addr1", "addr2", "city", "state", "country", "zip", "phone" }, new boolean[] { true, true, false, false, true, false, true, true, true, true, true }, new Integer[] { 255, 32, 50, null, 255, 255, 64, 64, 64, 32, 50 }, nextBtn, backBtn, true)); accessionPanel = new GenericFormPanel("ACCESSIONGLOBALLY", "ENTER_ACC_INFO", getHelpCntxt("wizard_choose_accession_level"), new String[] { "ACCGLOBALLY" }, new String[] { "accglobal" }, new String[] { "checkbox" }, nextBtn, backBtn, true); panels.add(accessionPanel); if (wizardType == WizardType.Institution) { accessionPickerGbl = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, null); panels.add(accessionPickerGbl); } storageTDPanel = new TreeDefSetupPanel(StorageTreeDef.class, getResourceString("Storage"), "Storage", getHelpCntxt("wizard_configure_storage_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, null); panels.add(storageTDPanel); panels.add(new InstSetupPanel("CREATEINST", "CREATEINST", getHelpCntxt("wizard_create_institution"), new String[] {}, new String[] {}, new Integer[] {}, nextBtn, backBtn, true)); } if (wizardType == WizardType.Institution || wizardType == WizardType.Division) { DivisionPanel divPanel = new DivisionPanel("DIV", "ENTER_DIV_INFO", getHelpCntxt("wizard_enter_division"), new String[] { "NAME", "ABBREV" }, new String[] { "divName", "divAbbrev" }, new Integer[] { 255, 64 }, nextBtn, backBtn, true); panels.add(divPanel); if (wizardType == WizardType.Division) { HelpMgr.registerComponent(helpBtn, divPanel.getHelpContext()); } } if (wizardType != WizardType.Institution) { Institution institution = AppContextMgr.getInstance().getClassObject(Institution.class); Division division = AppContextMgr.getInstance().getClassObject(Division.class); if (!institution.getIsAccessionsGlobal()) { String sql = "SELECT ans.FormatName FROM autonumberingscheme ans Inner Join autonumsch_div ad ON ans.AutoNumberingSchemeID = ad.AutoNumberingSchemeID " + "INNER JOIN division d ON ad.DivisionID = d.UserGroupScopeId WHERE d.DivisionID = " + division.getId(); log.debug(sql); Vector<Object> rows = BasicSQLUtils.querySingleCol(sql); if (rows.size() == 1) { accessionFmt = rows.get(0).toString(); } else { log.error("The return " + rows.size()); } } } if (wizardType == WizardType.Institution || wizardType == WizardType.Division || wizardType == WizardType.Discipline) { nextBtn.setEnabled(false); disciplinePanel = new DisciplinePanel(getHelpCntxt("wizard_choose_discipline_type"), nextBtn, backBtn); panels.add(disciplinePanel); if (wizardType == WizardType.Discipline) { HelpMgr.registerComponent(helpBtn, disciplinePanel.getHelpContext()); } taxonTDPanel = new TreeDefSetupPanel(TaxonTreeDef.class, getResourceString("Taxon"), "Taxon", getHelpCntxt("wizard_configure_taxon_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, disciplinePanel); panels.add(taxonTDPanel); panels.add(new TaxonLoadSetupPanel(getHelpCntxt("wizard_preload_taxon"), nextBtn, backBtn)); geoTDPanel = new TreeDefSetupPanel(GeographyTreeDef.class, getResourceString("Geography"), "Geography", getHelpCntxt("wizard_configure_geography_tree"), "CONFIG_TREEDEF", nextBtn, backBtn, disciplinePanel); panels.add(geoTDPanel); } CollectionPanel colPanel = new CollectionPanel("COLLECTION", "ENTER_COL_INFO", getHelpCntxt("wizard_create_collection"), new String[] { "NAME", "PREFIX", }, new String[] { "collName", "collPrefix", }, new Integer[] { 50, 50 }, nextBtn, backBtn, true); panels.add(colPanel); if (wizardType == WizardType.Collection) { HelpMgr.registerComponent(helpBtn, colPanel.getHelpContext()); } catNumPicker = new FormatterPickerPanel("CATNOFMT", getHelpCntxt("wizard_create_catalog_number"), nextBtn, backBtn, true, null); panels.add(catNumPicker); if (wizardType != WizardType.Institution) { Division division = AppContextMgr.getInstance().getClassObject(Division.class); String sql = "SELECT COUNT(*) FROM division d INNER JOIN collection c ON d.UserGroupScopeId = c.DisciplineID WHERE d.UserGroupScopeId = " + division.getId(); log.debug(sql); int numCollectionsByDiv = BasicSQLUtils.getCountAsInt(sql); if (numCollectionsByDiv == 0) { Institution inst = AppContextMgr.getInstance().getClassObject(Institution.class); if (inst != null && !inst.getIsAccessionsGlobal()) { //if (wizardType != WizardType.Division) { accessionPickerCol = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, accessionFmt); accessionPickerCol.setDoingDisciplineCollection(wizardType != WizardType.Division); panels.add(accessionPickerCol); } } } } else { accessionPickerCol = new FormatterPickerPanel("ACCNOFMT", getHelpCntxt("wizard_create_accession_number"), nextBtn, backBtn, false, null); panels.add(accessionPickerCol); } panels.add(new SummaryPanel("SUMMARY", getHelpCntxt("wizard_summary"), nextBtn, backBtn, panels)); lastStep = panels.size(); if (backBtn != null) { backBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (step > 0) { if (disciplinePanel != null) { DisciplineType disciplineType = disciplinePanel.getDisciplineType(); if (disciplineType != null && disciplineType.isPaleo() && panels.get(step - 1) instanceof TaxonLoadSetupPanel) { //step--; } } if (panels.get(step - 1) == accessionPickerGbl) { if (!((Boolean) props.get("accglobal"))) { step--; } } if (panels.get(step - 1) == accessionPickerCol) { boolean isAccGlobal; if (accessionPanel != null) { accessionPanel.getValues(props); isAccGlobal = (Boolean) props.get("accglobal"); } else { Institution inst = AppContextMgr.getInstance().getClassObject(Institution.class); isAccGlobal = inst != null && !inst.getIsAccessionsGlobal(); } if (isAccGlobal) { step--; } } step--; panels.get(step).doingPrev(); HelpMgr.registerComponent(helpBtn, panels.get(step).getHelpContext()); cardLayout.show(cardPanel, Integer.toString(step)); } updateBtnBar(); if (listener != null) { listener.panelChanged(getResourceString(panels.get(step).getPanelName() + ".TITLE")); listener.helpContextChanged(panels.get(step).getHelpContext()); } } }); backBtn.setEnabled(false); } nextBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (step == lastStep - 2) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Component c = SpecifyDBSetupWizard.this.getParent(); while (!(c instanceof Window) && c != null) { c = c.getParent(); } if (c != null) { ((Window) c).pack(); } } }); } if (step < lastStep - 1) { DisciplineType disciplineType = null; if (disciplinePanel == null) { Discipline discipline = AppContextMgr.getInstance().getClassObject(Discipline.class); disciplineType = DisciplineType.getByName(discipline.getType()); } else { disciplineType = disciplinePanel.getDisciplineType(); } panels.get(step).getValues(props); panels.get(step).aboutToLeave(); if (step == 1) { String isCnvUploadVal = props.getProperty(DatabasePanel.DB_STRUCT_ONLY); boolean isCnvUpload = StringUtils.isNotEmpty(isCnvUploadVal) ? isCnvUploadVal.equals("true") : false; if (isCnvUpload) { setupLoginPrefs(); JOptionPane.showMessageDialog(UIRegistry.getTopWindow(), getResourceString("CONVUPLD_DONE"), getResourceString("COMPLETE"), JOptionPane.INFORMATION_MESSAGE); SpecifyDBSetupWizard.this.listener.finished(); return; } } if (disciplineType != null && disciplineType.isPaleo() && panels.get(step) instanceof TreeDefSetupPanel && ((TreeDefSetupPanel) panels.get(step)).getClassType() == TaxonTreeDef.class) { //step++; } if (panels.get(step) == accessionPanel) { accessionPanel.getValues(props); if (!((Boolean) props.get("accglobal"))) { step++; } } if (panels.get(step) == catNumPicker) { if (accessionPanel != null) { accessionPanel.getValues(props); boolean isAccGlobal = (Boolean) props.get("accglobal"); if (isAccGlobal) { step++; } } } advanceToNextPanel(); } else { nextBtn.setEnabled(false); if (wizardType == WizardType.Institution) { configSetup(); configureDatabase(); } else { //SpecifyDBSetupWizard.this.listener.hide(); SpecifyDBSetupWizard.this.listener.finished(); } } } }); cancelBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { if (SpecifyDBSetupWizard.this.listener != null) { if (step == lastStep) { SpecifyDBSetupWizard.this.listener.finished(); } else { if (UIHelper.promptForAction("QUIT", "NO", "CANCEL", getResourceString("SURE_QUIT"))) { SpecifyDBSetupWizard.this.listener.cancelled(); } } } } }); for (int i = 0; i < panels.size(); i++) { cardPanel.add(Integer.toString(i), panels.get(i)); panels.get(i).setValues(props); } cardLayout.show(cardPanel, "0"); if (dbPanel != null) { dbPanel.updateBtnUI(); } PanelBuilder builder = new PanelBuilder(new FormLayout("f:p:g", "f:p:g,10px,p")); builder.add(cardPanel, cc.xy(1, 1)); builder.add(btnBar, cc.xy(1, 3)); builder.setDefaultDialogBorder(); setLayout(new BorderLayout()); PanelBuilder iconBldr = new PanelBuilder(new FormLayout("20px, f:p:g,p,f:p:g,8px", "20px,t:p,f:p:g, 8px")); JLabel iconLbl = new JLabel(IconManager.getIcon(getIconName())); iconLbl.setVerticalAlignment(SwingConstants.TOP); iconBldr.add(iconLbl, cc.xy(2, 3)); add(iconBldr.getPanel(), BorderLayout.WEST); add(builder.getPanel(), BorderLayout.CENTER); progressBar = new JProgressBar(0, lastStep - 1); progressBar.setStringPainted(true); add(progressBar, BorderLayout.SOUTH); panels.get(0).updateBtnUI(); }
From source file:com.proyecto.vista.MantenimientoPeriodo.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 Periodo?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { periodoControlador.setearVigenteFalse(); periodoControlador.getSeleccionado().setPeriodo(Integer.parseInt(periodoField.getText())); periodoControlador.getSeleccionado().setFechaCreacion(jDateFecha.getDate()); periodoControlador.getSeleccionado().setVigente(chckVigente.isSelected()); periodoControlador.accion(accion); lista.add(periodoControlador.getSeleccionado()); if (accion == 1) { JOptionPane.showMessageDialog(null, "Periodo " + palabra2 + " correctamente", "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE); FormularioUtil.limpiarComponente(panelDatos); } else { JOptionPane.showMessageDialog(null, "Periodo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); }//ww w . jav a2 s .c o m } else { FormularioUtil.limpiarComponente(panelDatos); JOptionPane.showMessageDialog(null, "Periodo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else if (accion == 2) { palabra = "modificar"; palabra2 = "modificado"; if (JOptionPane.showConfirmDialog(null, "Desea " + palabra + " el Periodo?", "Mensaje del Sistema", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { if (accion == 2) { JOptionPane.showMessageDialog(null, "Periodo " + palabra2 + " correctamente", "Mensaje del Sistema", JOptionPane.INFORMATION_MESSAGE); lista.clear(); periodoControlador.getSeleccionado().setPeriodo(Integer.parseInt(periodoField.getText())); periodoControlador.getSeleccionado().setFechaCreacion(jDateFecha.getDate()); periodoControlador.getSeleccionado().setVigente(chckVigente.isSelected()); periodoControlador.accion(accion); listar(); FormularioUtil.limpiarComponente(panelDatos); } else { JOptionPane.showMessageDialog(null, "Periodo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } else { FormularioUtil.limpiarComponente(panelDatos); JOptionPane.showMessageDialog(null, "Periodo no " + palabra2, "Mensaje del Sistema", JOptionPane.ERROR_MESSAGE); } } FormularioUtil.activarComponente(panelOpciones, true); FormularioUtil.activarComponente(panelGuardar, false); FormularioUtil.activarComponente(panelDatos, false); }
From source file:com.xmage.launcher.XMageLauncher.java
private void checkXMage() { try {//from w ww . j a v a 2 s . c o m String xmageAvailableVersion = (String) config.getJSONObject("XMage").get(("version")); String xmageInstalledVersion = Config.getInstalledXMageVersion(); textArea.append(messages.getString("xmage.installed") + xmageInstalledVersion + "\n"); textArea.append(messages.getString("xmage.available") + xmageAvailableVersion + "\n"); noXMage = false; newXMage = false; if (!xmageAvailableVersion.equals(xmageInstalledVersion)) { newXMage = true; String xmageMessage = ""; String xmageTitle = ""; if (xmageInstalledVersion.isEmpty()) { noXMage = true; textArea.append(messages.getString("xmage.none") + "\n"); xmageMessage = messages.getString("xmage.none.message"); xmageTitle = messages.getString("xmage.none"); } else { textArea.append(messages.getString("xmage.new") + "\n"); xmageMessage = messages.getString("xmage.new.message"); xmageTitle = messages.getString("xmage.new"); } if (!noJava && !noXMage) JOptionPane.showMessageDialog(frame, xmageMessage, xmageTitle, JOptionPane.INFORMATION_MESSAGE); } } catch (JSONException ex) { logger.error("Error: ", ex); } }
From source file:edu.ku.brc.specify.config.init.RegisterSpecify.java
/** * Registers the Institution and makes it be not Anonymous anymore. (Non-static version) */// w w w. ja va2s .co m private void registerInternal(final boolean forceRegistration) { AppPreferences localPrefs = AppPreferences.getLocalPrefs(); SpecifyUser spUser = AppContextMgr.getInstance().getClassObject(SpecifyUser.class); if (forceRegistration && !spUser.getUserType().equals(SpecifyUserTypes.UserType.Manager.toString())) { if (forceRegistration) { UIRegistry.showLocalizedMsg(null, "SpReg.MUSTBECM"); } return; } Institution inst = AppContextMgr.getInstance().getClassObject(Institution.class); Collection collection = AppContextMgr.getInstance().getClassObject(Collection.class); Boolean hasBeenAsked = inst.getHasBeenAsked(); boolean isAnonymous = isAnonymous(); if (!hasInstitutionRegistered() || (forceRegistration && isAnonymous)) { if (forceRegistration) { if (!isAnonymous) // this really shouldn't happen { UIRegistry.showLocalizedMsg(JOptionPane.INFORMATION_MESSAGE, "SpReg.REGISTER", "SpReg.ITMS_REGED"); return; } setIsAnonymous(false); // if it failt to get the registration numbers the first time, try again. if (!hasInstitutionRegistered()) { doStartRegister(RegisterType.Institution, false, false); // will register everything } localPrefs.putBoolean(EXTRA_CHECK, true); UIRegistry.showLocalizedMsg(JOptionPane.INFORMATION_MESSAGE, "SpReg.REGISTER", "SpReg.ITMS_REGED"); } else if (!hasBeenAsked) { boolean okToReg = false/*askToReg(DBTableIdMgr.getInstance().getTitleForId(Collection.getClassTableId()), collection.getCollectionName())*/; setHasBeenAsked(); if (okToReg) { setIsAnonymous(false); doStartRegister(RegisterType.Institution, false, false); // will register everything } else { setIsAnonymous(true); doStartRegister(RegisterType.Institution, true, false); localPrefs.putBoolean(EXTRA_CHECK, false); } } } else { // Institution has been registered. // so it is OK to register unregistered Disciplines and Collections if (!hasDisciplineRegistered()) { doStartRegister(RegisterType.Division, isAnonymous, false); } else if (!hasDivisionRegistered()) { doStartRegister(RegisterType.Discipline, isAnonymous, false); } else if (!hasCollectionRegistered()) { doStartRegister(RegisterType.Collection, isAnonymous, false); } else if (forceRegistration) { showRegisteredNumbers(isAnonymous); } } }
From source file:com.biosis.biosislite.vistas.inventario.MantenimientoFactura.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.LETRA, this.nombreField, "Nombre")); FormularioUtil.validar2(array);//from ww w .ja v a2 s.c o m 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) { facturaControlador.getSeleccionado().setNumeroFactura(nombreField.getText()); facturaControlador.getSeleccionado().setFecha(jDateFecha.getDate()); facturaControlador.getSeleccionado().setRuta(facturaField.getText()); facturaControlador.accion(accion); lista.add(facturaControlador.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(); facturaControlador.getSeleccionado().setNumeroFactura(nombreField.getText()); facturaControlador.getSeleccionado().setFecha(jDateFecha.getDate()); facturaControlador.getSeleccionado().setRuta(facturaField.getText()); facturaControlador.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.limpiarComponente(panelFoto); FormularioUtil.activarComponente(panelOpciones, true); FormularioUtil.activarComponente(panelGuardar, false); FormularioUtil.activarComponente(panelDatos, false); lblFactura.setIcon(null); } }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectCreate.java
private void checkProjectName(String projectName) { projectName = projectName.trim();//from w w w.j av a 2 s .co m boolean isPossibleToInsert = true; log.debug("-------checkProjectName.projectName----" + projectName + ":--"); if (projectName.length() == 0) { JOptionPane.showMessageDialog(null, "Input Projecct Name!", "ProjectName", JOptionPane.ERROR_MESSAGE); isPossibleToInsert = false; } else { PolicyCheckResult result = ProjectNamePolicy.checkProjectName(projectName); if (result.getResult() != PolicyCheckResult.PROJECT_NAME_OK) { JOptionPane.showMessageDialog(null, result.getResultMsg(), "Invalid project name", JOptionPane.ERROR_MESSAGE); isPossibleToInsert = false; } else if (UISDKInterfaceManager.getSDKInterface().isExistedProjectName(projectName, null) == true) { JOptionPane.showMessageDialog(null, "\"" + projectName + "\" is already exists on the Protex Server.\nYou should use other name.", "Duplicated ProjectName", JOptionPane.ERROR_MESSAGE); isPossibleToInsert = false; } } if (isPossibleToInsert == true) { JOptionPane.showMessageDialog(null, "You can use the name of \"" + projectName + "\".", "ProjectName", JOptionPane.INFORMATION_MESSAGE); jButtonCheck.setEnabled(false); jButtonOK.setEnabled(true); jButtonBrowse.requestFocusInWindow(); } else { jButtonCheck.setEnabled(true); jButtonOK.setEnabled(false); jTextFieldNewProjectName.setSelectionStart(0); jTextFieldNewProjectName.setSelectionEnd(jTextFieldNewProjectName.getText().length()); jLabelNewProjectName.requestFocusInWindow(); } }