當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。