當前位置: 首頁>>代碼示例>>Java>>正文


Java Alert.initStyle方法代碼示例

本文整理匯總了Java中javafx.scene.control.Alert.initStyle方法的典型用法代碼示例。如果您正苦於以下問題:Java Alert.initStyle方法的具體用法?Java Alert.initStyle怎麽用?Java Alert.initStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Alert的用法示例。


在下文中一共展示了Alert.initStyle方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAlert

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public static Alert getAlert(String header, String content, AlertType alertType, Modality modality, Window window,
		StageStyle style) {
	Alert alert = new Alert(alertType);

	alert.setTitle(Values.MAIN_TITLE);
	alert.setHeaderText(header);
	alert.setContentText(content);

	alert.initModality(modality);
	alert.initOwner(window);
	alert.initStyle(style);

	return alert;
}
 
開發者ID:zhazhapan,項目名稱:qiniu,代碼行數:15,代碼來源:Dialogs.java

示例2: doQuestion

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Makes a question to the user.
 *
 * @param text
 *            the text
 * @return true, if successful
 */
public static boolean doQuestion(String text , Stage window) {
	boolean[] questionAnswer = { false };
	
	// Show Alert
	Alert alert = new Alert(AlertType.CONFIRMATION);
	alert.initStyle(StageStyle.UTILITY);
	alert.initOwner(window);
	alert.setHeaderText("Question");
	alert.setContentText(text);
	alert.showAndWait().ifPresent(answer -> questionAnswer[0] = ( answer == ButtonType.OK ));
	
	return questionAnswer[0];
}
 
開發者ID:goxr3plus,項目名稱:JavaFXApplicationAutoUpdater,代碼行數:21,代碼來源:ActionTool.java

示例3: show

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Shows the alert
 */
public void show(){
    dialog = new Alert(type);
    dialog.setTitle("Alert");
    dialog.setContentText(msg);
    dialog.setResizable(false);
    dialog.initStyle(style);
    dialog.showAndWait();
}
 
開發者ID:cbrnrd,項目名稱:AlertFX,代碼行數:12,代碼來源:MsgBox.java

示例4: showNonblock

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Shows the alert, but it isn't always on top
 */
public void showNonblock(){
    dialog = new Alert(type);
    dialog.setTitle("Alert");
    dialog.setContentText(msg);
    dialog.setResizable(false);
    dialog.initStyle(style);
    dialog.show();
}
 
開發者ID:cbrnrd,項目名稱:AlertFX,代碼行數:12,代碼來源:MsgBox.java

示例5: show

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
* Shows the alert
*/
public void show(){
    Alert alert = new Alert(Alert.AlertType.WARNING);
    alert.initStyle(style);
    alert.setContentText(warning);
    alert.setHeaderText(header);
    alert.showAndWait();
}
 
開發者ID:cbrnrd,項目名稱:AlertFX,代碼行數:11,代碼來源:Warn.java

示例6: showNonblock

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
* Shows the alert but isn't always on top
*/
public void showNonblock(){
    Alert alert = new Alert(Alert.AlertType.WARNING);
    alert.initStyle(style);
    alert.setContentText(warning);
    alert.setHeaderText(header);
    alert.show();
}
 
開發者ID:cbrnrd,項目名稱:AlertFX,代碼行數:11,代碼來源:Warn.java

示例7: show

import javafx.scene.control.Alert; //導入方法依賴的package包/類
/**
 * Shows the alert
 * @return <code>true</code> if "Yes" was pressed, else return false
 */
public boolean show(){
    alert = new Alert(Alert.AlertType.CONFIRMATION, question, ButtonType.YES, ButtonType.NO);
    alert.initStyle(style);
    Optional<ButtonType> result = alert.showAndWait();
    if (result.isPresent()) if (result.get() == ButtonType.YES) return true;
    return false;
}
 
開發者ID:cbrnrd,項目名稱:AlertFX,代碼行數:12,代碼來源:QuestionBox.java

示例8: deleteMoment

import javafx.scene.control.Alert; //導入方法依賴的package包/類
public void deleteMoment(){
	
	Alert alert = new Alert(AlertType.CONFIRMATION);
   	alert.setTitle("Avertissement suppression");
   	alert.setHeaderText("Vous allez supprimer le moment et tous ses sous-moments");
   	alert.setContentText("Voulez-vous continuer ?");
   	alert.initStyle(StageStyle.UTILITY);

   	Optional<ButtonType> result = alert.showAndWait();
   	if (result.get() == ButtonType.OK){
   		for (Node m : main.getGrid().getChildren()) {
       		int pos = main.getGrid().getChildren().indexOf(m);
       		MomentExpVBox mom = (MomentExpVBox)m;
			LinkedList<Node> moments = new LinkedList<Node>();
       		if (mom.getMoment().equals(moment)) {
       			
       			for (int i = 0; i < main.getGrid().getChildren().size(); i++) {;
       				moments.add(main.getGrid().getChildren().get(i));
				}
       			moments.remove(pos);
       			main.getGrid().getChildren().clear();
       			for (int j = 0; j < moments.size(); j++) {
					main.getGrid().add(moments.get(j), j, 0);
				}
       			
       			// if number of elements sup to 1 remove one row
       			if((main.getGrid().getColumnConstraints().size() > 1)){
       				main.getGrid().getColumnConstraints().remove(main.getGrid().getColumnConstraints().size()-1);
       				main.getCurrentDescription().setNumberCols(main.getCurrentDescription().getNumberCols()-1);
       			}
				main.getCurrentDescription().getMoments().remove(mom.getMoment());
				
				// Actualize the col of the model
				for (int i = 0; i < main.getGrid().getChildren().size()-1; i++) {
					main.getCurrentDescription().getMoments().get(i).setGridCol(i);
				}
				break;
			}
       		else{
       			removeMomentFromParent(mom,main);
       		}
		}
   	}
}
 
開發者ID:coco35700,項目名稱:uPMT,代碼行數:45,代碼來源:MomentExpVBox.java


注:本文中的javafx.scene.control.Alert.initStyle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。