当前位置: 首页>>代码示例>>Java>>正文


Java JOptionPane.YES_OPTION属性代码示例

本文整理汇总了Java中javax.swing.JOptionPane.YES_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java JOptionPane.YES_OPTION属性的具体用法?Java JOptionPane.YES_OPTION怎么用?Java JOptionPane.YES_OPTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.JOptionPane的用法示例。


在下文中一共展示了JOptionPane.YES_OPTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: gotFocus

public void gotFocus() {
	// Chiedere a utente se cancellare tutto
	if (model.getMatrix() != null) {
		System.out.println("MODEL");
		if (JOptionPane.showConfirmDialog(this, "This operation resets all data. Continue ?", "WARNING", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
			model.resetModel();
			resetOnNew();
			((JWatWizard) getParentWizard()).setEnableButton("Solve", false);
		} else {
			parent.setLastPanel();
		}
	} else {
		((JWatWizard) getParentWizard()).setEnableButton("Solve", false);
	}
	parent.setCurrentPanel(WORKLOAD_INPUT_PANEL);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:16,代码来源:InputPanel.java

示例2: BTNcadastroActionPerformed

private void BTNcadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTNcadastroActionPerformed
    // TODO add your handling code here:
    String msg = "Deseja realmente cadastrar?";
    String title = "Cadastro de Professor";
    int reply = JOptionPane.showConfirmDialog(null, msg, title, JOptionPane.YES_NO_OPTION);
    if (reply == JOptionPane.YES_OPTION)
    {
        // Incrementar Banco de Dados
        Professor prof = new Professor();
        ProfessorController pc = new ProfessorController();
        
        prof.setNome(TXTnomeProf.getText());
        prof.setSiape(TXTsiape.getText());
        prof.setEmail(TXTemailProf.getText());
        prof.setCpf(TXTcpf.getText());
        prof.setSenha("padrao");
        
        JOptionPane.showMessageDialog(null, pc.inserir(prof));
    }
}
 
开发者ID:TheMagicFingers,项目名称:MuralEscolar,代码行数:20,代码来源:CadastroProfessor.java

示例3: addChildBranch

public void addChildBranch() {
    int row = table.getSelectedRow();
    if (row < 0)
        return;
    Node node = (Node) table.getPathForRow(row).getLastPathComponent();
    String message = GlobalResourcesManager
            .getString("BranchCreationWarning");
    if (node.branch.getChildren().size() > 0)
        message = GlobalResourcesManager
                .getString("BranchNodeCreationWarniong");
    if (JOptionPane.showConfirmDialog(framework.getMainFrame(), message,
            UIManager.getString("OptionPane.titleText"),
            JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) != JOptionPane.YES_OPTION)
        return;
    String s = JOptionPane.showInputDialog(framework.getMainFrame(),
            GlobalResourcesManager.getString("BranchCreationReason"),
            GlobalResourcesManager.getString("BranchCreationReason"),
            JOptionPane.QUESTION_MESSAGE);
    if (s == null)
        return;
    int type = node.branch.getType() - 1;
    if (node.branch.getChildren().size() > 0) {
        type = getMaxType(type, (Node) branchModel.getRoot());
    }
    engine.createBranch(node.branch.getBranchId(), s, type + 1, "core");
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:26,代码来源:BranchView.java

示例4: deleteB_actionPerformed

/**
 * Delete a resource type and update the list.
 * @param e
 */
void deleteB_actionPerformed(ActionEvent e) {
    MimeType mt = (MimeType) typesList.getSelectedValue();
    int n =
        JOptionPane.showConfirmDialog(
            App.getFrame(),
            Local.getString("Delete resource type")
                + "\n'"
                + mt.getLabel()
                + "'\n"
                + Local.getString("Are you sure?"),
            Local.getString("Delete resource type"),
            JOptionPane.YES_NO_OPTION);
    if (n != JOptionPane.YES_OPTION)
        return;
    MimeTypesList.removeMimeType(mt.getMimeTypeId());
    CurrentStorage.get().storeMimeTypesList();
    this.initTypesList();
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:22,代码来源:ResourceTypePanel.java

示例5: jButton2ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    // Agregar
    alerta=new AlertaInternacional(txtTitulo.getText(),jcbImportancia.getSelectedIndex(),txtDescripcion.getText(),jcbUbicacion.getSelectedItem().toString());
    alerta.insertarEnDB();
    mf.alertas.add(alerta);//try catch
    //mf.setTxtArea( mf.getTxtArea()+"\n"+alerta.toString());
    
    int opt=showOptionDialog(null, "¿Desea crear mas alertas?","Mas alertas",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
        switch (opt) {
            case JOptionPane.YES_OPTION:
                txtTitulo.requestFocus();
                break;
            case JOptionPane.NO_OPTION:
                this.dispose();
                break;
            case JOptionPane.CANCEL_OPTION:
                break;
            default:
                break;
        }
}
 
开发者ID:raulgarciadevop,项目名称:sic-public,代码行数:21,代码来源:NewAlerta.java

示例6: deleteScenarios

private void deleteScenarios() {
    List<ScenarioNode> scenarioNodes = getSelectedScenarioNodes();
    if (!scenarioNodes.isEmpty()) {
        int option = JOptionPane.showConfirmDialog(null,
                "<html><body><p style='width: 200px;'>"
                + "Are you sure want to delete the following Scenarios?<br>"
                + scenarioNodes
                + "</p></body></html>",
                "Delete Scenario",
                JOptionPane.YES_NO_OPTION);
        if (option == JOptionPane.YES_OPTION) {
            LOGGER.log(Level.INFO, "Delete Scenarios approved for {0}; {1}",
                    new Object[]{scenarioNodes.size(), scenarioNodes});
            for (ScenarioNode scenarioNode : scenarioNodes) {
                deleteTestCases(Collections.list(scenarioNode.children()));
                scenarioNode.getScenario().delete();
                getTreeModel().removeNodeFromParent(scenarioNode);
            }
        }
    }
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:21,代码来源:ProjectTree.java

示例7: btnSalvarActionPerformed

private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed
    File arq = util.Dialogos.ShowDlgSaveAsAny(this.getRootPane(), "");
    if (arq == null) {
        return;
    }
    if (arq.exists()) {
        if (util.Dialogos.ShowMessageConfirm(getRootPane(), Editor.fromConfiguracao.getValor("Controler.MSG_QUESTION_REWRITE")) != JOptionPane.YES_OPTION) {
            return;
        }
    }
    try {
        FileWriter fw = new FileWriter(arq.getAbsoluteFile(), true);
        TextArea.write(fw);
    } catch (IOException iOException) {
        util.BrLogger.Logger("ERROR_DIAGRAMA_SAVE_ANY", iOException.getMessage());
    }
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:17,代码来源:EditorTexto.java

示例8: checkForSave

/**
 * Checks if there's an old graph to save. This methods is called when creates/closes/opens a graph.
 * @param msg The message to display.
 * @return <code>true</code> - whether the user accepts to save the graph, or he cancels the current action.
 */
public boolean checkForSave(String msg) {
	// Checks if there's an old graph to save
	if (model != null && model.toBeSaved()) {
		int resultValue = JOptionPane.showConfirmDialog(mainWindow, msg, "JSIMgraph - Warning", JOptionPane.YES_NO_CANCEL_OPTION,
				JOptionPane.WARNING_MESSAGE);
		if (resultValue == JOptionPane.YES_OPTION) {
			saveModel();
			return true;
		}
		if (resultValue == JOptionPane.CANCEL_OPTION) {
			return true;
		}
	}
	return false;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:20,代码来源:Mediator.java

示例9: succeeded

@Override
protected void succeeded(Object result) {
    if (JOptionPane.showConfirmDialog(null, "Do you want to open the kml master file?") == JOptionPane.YES_OPTION) {
        try {
            Desktop.getDesktop().open(new File(output + "/master.kml"));
        } catch (IOException ex) {
        	logger.error(ex.getMessage(),ex);
        }
    }
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:10,代码来源:BatchAnalysisGUI.java

示例10: showContinueDialog

/**
 * Creates and shows a confirmation dialog for continuing the current
 * edit.
 */
private boolean showContinueDialog(String value) {
    int response = JOptionPane.showConfirmDialog(PropertiesTable.this,
        getContinueQuestion(value),
        null,
        JOptionPane.YES_NO_OPTION);
    return response == JOptionPane.YES_OPTION;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:11,代码来源:PropertiesTable.java

示例11: doSaveLocations

synchronized public void doSaveLocations() {
    if (warnSave) {
        int ret = JOptionPane.showConfirmDialog(chip.getAeViewer().getFilterFrame(), "Really overwrite " + lastFileName + " ?", "Overwrite warning", JOptionPane.WARNING_MESSAGE);
        if (ret != JOptionPane.YES_OPTION) {
            log.info("save canceled");
            return;
        }
    }
    File f = new File(lastFileName);
    saveLocations(new File(lastFileName));
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:11,代码来源:TargetLabeler.java

示例12: removeEventB_actionPerformed

void removeEventB_actionPerformed(ActionEvent e) {
		String msg;
		net.sf.memoranda.Event ev;

		if(eventsTable.getSelectedRows().length > 1) 
			msg = Local.getString("Remove") + " " + eventsTable.getSelectedRows().length 
				+ " " + Local.getString("events") + "\n" + Local.getString("Are you sure?");
		else {
			ev = (net.sf.memoranda.Event) eventsTable.getModel().getValueAt(
                eventsTable.getSelectedRow(),
                EventsTable.EVENT);
			msg = Local.getString("Remove event") + "\n'" 
				+ ev.getText() + "'\n" + Local.getString("Are you sure?");
		}

        int n =
            JOptionPane.showConfirmDialog(
                App.getFrame(),
                msg,
                Local.getString("Remove event"),
                JOptionPane.YES_NO_OPTION);
        if (n != JOptionPane.YES_OPTION) return;

        for(int i=0; i< eventsTable.getSelectedRows().length;i++) {
			ev = (net.sf.memoranda.Event) eventsTable.getModel().getValueAt(
                  eventsTable.getSelectedRows()[i], EventsTable.EVENT);
        EventsManager.removeEvent(ev);
		}
        eventsTable.getSelectionModel().clearSelection();
/*        CurrentStorage.get().storeEventsManager();
        eventsTable.refresh();
        EventsScheduler.init();
        parentPanel.calendar.jnCalendar.updateUI();
        parentPanel.updateIndicators();
*/ saveEvents();  
  }
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:36,代码来源:EventsPanel.java

示例13: actionPerformed

@Override
public void actionPerformed(ActionEvent e) {
    int i = table.getSelectedRow();
    if (i < 0)
        return;
    List<Row> rows = new ArrayList<Row>();

    for (int j : table.getSelectedRows()) {
        rows.add(data.get(table.convertRowIndexToModel(j)));
    }

    long[] ls = new long[rows.size()];
    for (int j = 0; j < ls.length; j++)
        ls[j] = rows.get(j).getElementId();

    DeleteStatusList list = framework.getAccessRules()
            .getElementsDeleteStatusList(ls);
    if (list.size() > 0) {
        if (!StatusMessageFormat.deleteElements(list, null, framework))
            return;
    } else {
        if (JOptionPane.showConfirmDialog(table, GlobalResourcesManager
                        .getString("DeleteActiveElementsDialog.Warning"),
                GlobalResourcesManager
                        .getString("ConfirmMessage.Title"),
                JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
            return;
    }

    streams.startUserTransaction();

    for (Row row : rows) {
        streams.deleteRow(row);

    }

    streams.commitUserTransaction();
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:38,代码来源:StreamsTabView.java

示例14: getUserFeedbackForClosingProject

@Override
public ProjectCloseUserFeedback getUserFeedbackForClosingProject(String msgTitle, String msgText) {

	ProjectCloseUserFeedback userFeedback = null;
	int msgAnswer = JOptionPane.showConfirmDialog(Application.getMainWindow(), msgText, msgTitle, JOptionPane.YES_NO_CANCEL_OPTION);
	if (msgAnswer == JOptionPane.CANCEL_OPTION) {
		userFeedback = ProjectCloseUserFeedback.CancelCloseAction;
	} else if (msgAnswer == JOptionPane.YES_OPTION) {
		userFeedback = ProjectCloseUserFeedback.SaveProject;
	} else if (msgAnswer == JOptionPane.NO_OPTION) {
		userFeedback = ProjectCloseUserFeedback.DoNotSaveProject;
	}
	return userFeedback;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:14,代码来源:ProjectWindow.java

示例15: listOfListsKeyPressed

private void listOfListsKeyPressed(
    java.awt.event.KeyEvent evt) {//GEN-FIRST:event_listOfListsKeyPressed
    if ((evt.getKeyCode() == KeyEvent.VK_DELETE || evt.getKeyCode() == KeyEvent.VK_BACK_SPACE)
        && listOfLists.getSelectedIndex() != -1) {
        if (JOptionPane.showConfirmDialog(this,
            locMes("del1") + " \"" + ((DefaultListModel) (listOfLists.getModel()))
                .get(listOfLists.getSelectedIndex()) + "\"?", locMes("del2"),
            JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)
            != JOptionPane.YES_OPTION) {
            return;
        }
        ((DefaultListModel) (listOfLists.getModel())).remove(listOfLists.getSelectedIndex());
        saveState();
    }
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:15,代码来源:PComplexService.java


注:本文中的javax.swing.JOptionPane.YES_OPTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。