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


Java AlertType.WARNING属性代码示例

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


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

示例1: editClicked

public void editClicked(){
	if(lstudname.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Lecturer Selected");
           alert.setContentText("Please select a Lecturer in the list.");
           alert.showAndWait();
	}
	else
	{
		try {
			new EditLec().start(new Stage());
			EditLec.txtid.setText(lstudname.getText());
		} catch (Exception e) {
			ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
			e.printStackTrace();
		}
	}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:21,代码来源:LecturersReports.java

示例2: editClicked

public void editClicked(){
	if(lstudname.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Lecturer Selected");
           alert.setContentText("Please select a Lecturer in the list.");
           alert.showAndWait();
	}
	else
	{
		try {
			new EditVisitor().start(new Stage());
			EditVisitor.txtid.setText(lstudname.getText());
		} catch (Exception e) {
			ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
			e.printStackTrace();
		}
	}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:21,代码来源:VisitorsReports.java

示例3: setPressbEdit

public void setPressbEdit(){
	if(txtname.getText().equals("") || txtlevel.getText().equals(""))
	{		
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Person Selected");
           alert.setContentText("Please select a person in the table.");
           alert.showAndWait();
	}
	else
	{
		EditingClass ec= new EditingClass();
		ec.setToEdit();
	}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:16,代码来源:Users.java

示例4: editClicked

public void editClicked(){
	if(lstudname.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Person Selected");
           alert.setContentText("Please select a Staff in the list.");
           alert.showAndWait();
	}
	else
	{
		try {
			new EditOffice().start(new Stage());
			EditOffice.txtid.setText(lstudname.getText());
		} catch (Exception e) {
			ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
			e.printStackTrace();
		}
	}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:21,代码来源:OfficeRecords.java

示例5: handleEditEntry

@FXML
private void handleEditEntry() throws Exception {
	Entry selectedEntry = entryTable.getSelectionModel().getSelectedItem();

	if (selectedEntry != null) {
		boolean okClicked = mainApp.showAppEditDialog(selectedEntry);

		if (okClicked) {
			// removed description field
		}
	}
	else {
		Alert alert = new Alert(AlertType.WARNING);
		alert.initOwner(mainApp.getPrimaryStage());
		alert.setTitle("No Selection");
		alert.setHeaderText("No Entry Selected");
		alert.setContentText("Please select an entry in the table.");

		alert.showAndWait();
	}
}
 
开发者ID:yc45,项目名称:kanphnia2,代码行数:21,代码来源:ToDoOverviewController.java

示例6: handleDeleteEntry

@FXML
private void handleDeleteEntry() {
	int selectedIndex = entryTable.getSelectionModel().getSelectedIndex();

	if (selectedIndex >= 0) {
		entryTable.getItems().remove(selectedIndex);
	}
	else {
		Alert alert = new Alert(AlertType.WARNING);
		alert.initOwner(mainApp.getPrimaryStage());
		alert.setTitle("No Selection");
		alert.setHeaderText("No Entry Selected");
		alert.setContentText("Please select an entry in the table");
		alert.showAndWait();
	}
}
 
开发者ID:yc45,项目名称:kanphnia2,代码行数:16,代码来源:ToDoOverviewController.java

示例7: displayAlert

/**
 * Create and display an alert to the user.
 *
 * @param message
 *            string to display to user.
 */
private void displayAlert(String message) {
    Alert infoAlert = new Alert(AlertType.WARNING);
    infoAlert.setTitle(null);
    infoAlert.setHeaderText(null);
    infoAlert.setContentText(message);
    infoAlert.showAndWait();
}
 
开发者ID:Stevoisiak,项目名称:Virtual-Game-Shelf,代码行数:13,代码来源:NewGameWindow.java

示例8: warning

public static void warning(String title,String header,String body){
	Alert alert = new Alert(AlertType.WARNING);
	alert.setTitle(title);
	alert.setHeaderText(header);
	alert.setContentText(body);

	alert.showAndWait();
}
 
开发者ID:eacp,项目名称:Luna-Exam-Builder,代码行数:8,代码来源:Dialogs.java

示例9: warningAlert

public static Alert warningAlert(String header, String message, Throwable t) {
	Alert alert = new Alert(AlertType.WARNING);
	alert.setTitle("Warning");
	alert.setHeaderText(header);
	alert.setContentText(message);
	if(t != null)
		alert.getDialogPane().setExpandableContent(createExpandableContent(t));

	return alert;
}
 
开发者ID:vibridi,项目名称:fxutils,代码行数:10,代码来源:FXDialog.java

示例10: showWarning

public static Alert showWarning(String message) {
	Alert alert = new Alert(AlertType.WARNING);
	alert.setTitle("Warning");
	alert.setHeaderText(null);
	alert.setContentText(message);
	return alert;
}
 
开发者ID:nshusa,项目名称:osrs-data-converter,代码行数:7,代码来源:Dialogue.java

示例11: getFont

public static Font getFont(String name) {
	if (!Font.getFamilies().contains(name)) {
		Alert a = new Alert(AlertType.WARNING);
		a.setContentText("Could not find font " + name + ". Defaulting to system font.");
		a.show();
	}
	return Font.font(name);
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:8,代码来源:FontAdapter.java

示例12: showWarningDialogue

public static void showWarningDialogue(String title, String message)
{
	Alert alert = new Alert(AlertType.WARNING);
	alert.setTitle(title);
	alert.setHeaderText(null);
	alert.setContentText(message);
	
	alert.showAndWait();
}
 
开发者ID:dhawal9035,项目名称:WebPLP,代码行数:9,代码来源:Dialogues.java

示例13: deleteClicked

public void deleteClicked()
{
	if(lstudname.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Lecturer Selected");
           alert.setContentText("Please select a Lecturer in the list.");
           alert.showAndWait();
	}
	else
	{
	boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \n Lecturer? ");
		if(result)
		{
			ObservableList<Reports> selectedProd, allProd;
			allProd= tableView.getItems();
			selectedProd = tableView.getSelectionModel().getSelectedItems();
			//selectedProd.forEach(allProd:: remove);
	
			//the delete query is now complete  ------------------>
			String query = "DELETE FROM Lecturers where s_id = '" + lstudname.getText() + "'";
			//connect to database
			DBConnect.connect();
			try {
               DBConnect.stmt.execute(query);
               selectedProd.forEach(allProd:: remove);
               SuccessMessage.display("Success", "Lecturer has been deleted successfully");
               DBConnect.closeConnection();
			} catch (Exception ea) {
               ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
			} 
			}
		}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:36,代码来源:LecturersReports.java

示例14: deleteClicked

public void deleteClicked()
{
	if(lstudname.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Lecturer Selected");
           alert.setContentText("Please select a Visitor in the list.");
           alert.showAndWait();
	}
	else
	{
	boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \nVisitor? ");
		if(result)
		{
			ObservableList<Reports> selectedProd, allProd;
			allProd= tableView.getItems();
			selectedProd = tableView.getSelectionModel().getSelectedItems();
			//selectedProd.forEach(allProd:: remove);
	
			//the delete query is now complete  ------------------>
			String query = "DELETE FROM visitors where s_id = '" + lstudname.getText() + "'";
			//connect to database
			DBConnect.connect();
			try {
               DBConnect.stmt.execute(query);
               selectedProd.forEach(allProd:: remove);
               SuccessMessage.display("Success", "Lecturer has been deleted successfully");
               DBConnect.closeConnection();
			} catch (Exception ea) {
               ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
			} 
			}
		}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:36,代码来源:VisitorsReports.java

示例15: deleteClicked

public void deleteClicked()
{
	if(txtname.getText().equals("") || txtlevel.getText().equals(""))
	{
		// Nothing selected.
           Alert alert = new Alert(AlertType.WARNING);
           alert.setTitle("No Selection");
           alert.setHeaderText("No Person Selected");
           alert.setContentText("Please select a person in the table.");
           alert.showAndWait();
	}
	else
	{
	boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \n user? ");
		if(result)
		{
			ObservableList<UserCreation> selectedProd, allProd;
			allProd= table.getItems();
			selectedProd = table.getSelectionModel().getSelectedItems();
			//selectedProd.forEach(allProd:: remove);
	
			//the delete query is now complete  ------------------>
			String query = "DELETE FROM login where username='" + txtname.getText() + "'";
			//connect to database
			DBConnect.connect();
			try {
               DBConnect.stmt.execute(query);
               selectedProd.forEach(allProd:: remove);
               SuccessMessage.display("Success", "User has been deleted successfully");
               DBConnect.closeConnection();
			} catch (Exception ea) {
               ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
			} 
			}
		}
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:36,代码来源:Users.java


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