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


Java Stage.setAlwaysOnTop方法代码示例

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


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

示例1: Exe

import javafx.stage.Stage; //导入方法依赖的package包/类
void Exe(int i) {
    if(i==1) {
        warnmesse="プレイ開始から5分経過しました\n混雑している場合は次の人に\n交代してください";
        fontsize=25;
    }else if(i==2) {
        warnmesse="プレイ開始から10分経過しました\n混雑している場合は次の人に\n交代してください";
        fontsize=25;
    }else if(i==-1) {
    	warnmesse="user timer is reset";
    	fontsize=35;
    }

    final Stage primaryStage = new Stage(StageStyle.TRANSPARENT);
    primaryStage.initModality(Modality.NONE);
    final StackPane root = new StackPane();

    final Scene scene = new Scene(root, 350, 140);
    scene.setFill(null);

    final Label label = new Label(warnmesse);
    label.setFont(new Font("Arial", fontsize));
    BorderPane borderPane = new BorderPane();
    borderPane.setCenter(label);
    borderPane.setStyle("-fx-background-radius: 10;-fx-background-color: rgba(0,0,0,0.3);");

    root.getChildren().add(borderPane);

    final Rectangle2D d = Screen.getPrimary().getVisualBounds();
    primaryStage.setScene(scene);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.setX(d.getWidth()-350);
    primaryStage.setY(d.getHeight()-300);

    primaryStage.show();

    final Timeline timer = new Timeline(new KeyFrame(Duration.seconds(CLOSE_SECONDS), (ActionEvent event) -> primaryStage.close()));
    timer.setCycleCount(Timeline.INDEFINITE);
    timer.play();
}
 
开发者ID:chrootRISCassembler,项目名称:CapsLock,代码行数:40,代码来源:OverLayWindow.java

示例2: aendereReihenfolge

import javafx.stage.Stage; //导入方法依赖的package包/类
private void aendereReihenfolge(){
    Stage stage = new Stage();

    Label l = new Label("Reihenfolge festlegen:");
    l.setStyle("-fx-text-fill: white");
    l.setFont(Font.font(settingsFontSize));
    l.setTranslateY(25);
    l.setTranslateX(25);

    TextField tf = new TextField(String.valueOf(orderId+1));
    tf.setFont(Font.font(settingsFontSize-3));
    tf.setTranslateX(25);
    tf.setTranslateY(60);

    Button b = new Button("Speichern");
    b.setFont(Font.font(settingsFontSize));
    b.setTranslateX(25);
    b.setTranslateY(120);
    b.setOnAction(e -> {
        orderId = Integer.parseInt(tf.getText())-1;
        stage.close();
        Plugin_Gleisbelegung.sortiereGleiseListener();
    });

    Pane p = new Pane(l,tf,b);
    p.setStyle("-fx-background-color: #303030");
    p.setMinSize(500,200);
    p.setMaxSize(500, 200);

    Scene scene = new Scene(p, 300,200);

    stage.setScene(scene);
    stage.show();
    stage.setAlwaysOnTop(true);
}
 
开发者ID:manuel3108,项目名称:Gleisbelegung,代码行数:36,代码来源:Gleis.java

示例3: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(final Stage primaryStage) throws Exception
{

    this.preloaderStage = primaryStage;

    final ImageView splash = new ImageView(new Image(Constant.IMG_DIR + "banner.png"));

    this.loadProgressPhase = new JFXProgressBar();
    this.loadProgressPhase.setPrefWidth(Constant.SPLASH_WIDTH);

    this.splashLayout = new VBox();
    this.splashLayout.getChildren().addAll(splash, this.loadProgressPhase);

    this.splashLayout.setStyle("-fx-padding: 5; " + "-fx-background-color: gainsboro; " + "-fx-border-width:2; "
            + "-fx-border-color: " + "linear-gradient(" + "to bottom, " + "MediumSeaGreen, "
            + "derive(MediumSeaGreen, 50%)" + ");");
    this.splashLayout.setEffect(new DropShadow());

    final Scene splashScene = new Scene(this.splashLayout, Color.TRANSPARENT);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();

    primaryStage.setScene(splashScene);
    primaryStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - Constant.SPLASH_WIDTH / 2);
    primaryStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - Constant.SPLASH_HEIGHT / 2);
    primaryStage.getIcons().add(new Image(Constant.IMG_DIR + "icon.png"));
    primaryStage.setTitle(Constant.APP_NAME);

    primaryStage.initStyle(StageStyle.UNDECORATED);
    primaryStage.setAlwaysOnTop(true);
    primaryStage.show();

}
 
开发者ID:Leviathan-Studio,项目名称:MineIDE,代码行数:34,代码来源:MineIDEPreloader.java

示例4: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
	URL location = getClass().getResource("MainFXMLDocument.fxml");
	Parent root = FXMLLoader.load(location);
	
	root.setOnMouseDragged(e -> this.dragStage(e, stage));
	root.setOnMouseMoved(e -> this.calculateGap(e, stage));
	
	Scene scene = new Scene(root, Color.TRANSPARENT);
	scene.getStylesheets().add("/com/shekkar/xpanderfx/mainStyler.css");
	
	stage.setScene(scene);
	stage.setAlwaysOnTop(true);
	stage.initStyle(StageStyle.TRANSPARENT);		
	stage.show();	
}
 
开发者ID:ShekkarRaee,项目名称:xpanderfx,代码行数:17,代码来源:XpanderFX.java

示例5: showNoticeDialog

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
public void showNoticeDialog() {
	
	try {

		FXMLLoader loader = new FXMLLoader(Main.class.getResource("views/Notice.fxml"));
		StackPane page = (StackPane) loader.load();

		Stage dialog = new Stage();
		Scene scene = new Scene(page);
		dialog.getIcons().add(new Image("file:wdm.png"));
		dialog.setTitle("공지사항");
		dialog.initModality(Modality.WINDOW_MODAL);
		dialog.setResizable(false);
		dialog.setScene(scene);
		dialog.setAlwaysOnTop(true);
		dialog.show();

	} catch (Exception e) {
		e.printStackTrace();
	}
	
}
 
开发者ID:kimyearho,项目名称:WebtoonDownloadManager,代码行数:24,代码来源:MainController.java

示例6: alwaysInTop

import javafx.stage.Stage; //导入方法依赖的package包/类
public static void alwaysInTop(Alert alert) {
        try{
            DialogPane root = alert.getDialogPane();

            Stage dialogStage = new Stage(StageStyle.UTILITY);

            for (ButtonType buttonType : root.getButtonTypes()) {
                ButtonBase button = (ButtonBase) root.lookupButton(buttonType);
                button.setOnAction(evt -> {
                    root.setUserData(buttonType);
                    dialogStage.close();
                });
            }

            root.getScene().setRoot(new Group());

            Scene scene = new Scene(root);

            dialogStage.setScene(scene);
            dialogStage.initModality(Modality.APPLICATION_MODAL);
            dialogStage.setAlwaysOnTop(true);
            dialogStage.setResizable(false);
            dialogStage.showAndWait();
        }catch(Exception e){
            
        }
//        Optional<ButtonType> result = Optional.ofNullable((ButtonType) root.getUserData());
    }
 
开发者ID:mhusam,项目名称:ChessBot,代码行数:29,代码来源:UIUtils.java

示例7: openHelpText

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * @param url the url of the website to be shown
 */
public static void openHelpText(String title, String url) {
    WebView wv = new WebView();
    wv.getEngine().setJavaScriptEnabled(false);
    wv.getEngine().load(url);
    Scene pane = new Scene(wv);
    Stage state = new Stage();
    state.setScene(pane);
    //                pane.getButtonTypes().add(ButtonType.CLOSE);
    state.setAlwaysOnTop(true);
    state.setTitle(title);
    state.setResizable(true);
    state.setOpacity(0.8);
    state.setMinHeight(250);
    state.setMinWidth(250);
    state.show();
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:20,代码来源:ViewUtils.java

示例8: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
  Scene scene = new Scene(new Group(rectangle = new Rectangle(100, 100)), 300, 300);
  stage.setScene(scene);
  stage.setAlwaysOnTop(true);
  stage.show();
  config = DragSupport.bind(rectangle);
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:9,代码来源:DragSupportTest.java

示例9: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
  Scene scene = new Scene(new Group(rectangle = new Rectangle(100, 100)), 300, 300);
  rectangle.setLayoutX(100);
  rectangle.setLayoutY(100);
  stage.setScene(scene);
  stage.setAlwaysOnTop(true);
  stage.show();
  config = ResizeSupport.bind(rectangle);
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:11,代码来源:ResizeSupportTest.java

示例10: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
  this.stage = stage;
  Scene scene = new Scene(new Group(new Rectangle(100, 100)), 300, 300);
  stage.setScene(scene);
  stage.setAlwaysOnTop(true);
  stage.setX(0);
  stage.setY(0);
  stage.show();
  config = DragSupport.bind(stage);
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:12,代码来源:DragSupportWindowTest.java

示例11: createAndShowLoading

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * This method will create loading scene in new stage, show it to the user, and then return the object of loading
 * @return - created loading object
 */
public static WindowLoadingController createAndShowLoading() {
    Stage stage = new Stage();
    stage.setAlwaysOnTop(true);
    stage.setResizable(false);
    stage.setTitle("Loading");
    WindowLoadingController controller = new WindowLoadingController();
    stage.setScene(NodeType.WINDOW_LOADING.getScene(controller));
    stage.show();
    return controller;
}
 
开发者ID:Hackness,项目名称:KeepYourPassword,代码行数:15,代码来源:Main.java

示例12: initGraphics

import javafx.stage.Stage; //导入方法依赖的package包/类
protected void initGraphics(Stage stage) {
	scene = new Scene(new Region());
	scene.setFill(null);
	
	stage.setMaxWidth(1);
	stage.setMaxHeight(1);
	stage.setWidth(1);
	stage.setHeight(1);
	stage.getIcons().add(new javafx.scene.image.Image("resources/Logo.png"));
	
	stage.setResizable(false);
	stage.setAlwaysOnTop(true);
}
 
开发者ID:Team-Sprout,项目名称:Clipcon-Client,代码行数:14,代码来源:Notification.java

示例13: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {

    Platform.setImplicitExit(false);

    Injector.setConfigurationSource(config::getInjectionValue);
    Injector.setLogger(s -> LOG.info(s));
    Injector.setModelOrService(Logger.class, LOG);
    Injector.setModelOrService(HueSenseConfig.class, config);
    Injector.setModelOrService(DBManager.class, dbMan);
    Injector.setModelOrService(DataStore.class, store);
    Injector.setModelOrService(HueComm.class, hue);
    Injector.setModelOrService(LanComm.class, lan);
    Injector.setModelOrService(MailService.class, mailServ);

    ConnectingView connView = new ConnectingView();
    Scene scene = new Scene(connView.getView());
    scene.setFill(Color.WHITE);
    stage.setTitle("HueSense");
    final String uri = Thread.currentThread().getContextClassLoader().getResource("global.css").toExternalForm();
    scene.getStylesheets().add(uri);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.setScene(scene);
    stage.setAlwaysOnTop(true);
    stage.setResizable(false);

    stage.centerOnScreen();
    UIUtils.setIcon(stage);

    stage.show();

    hue.startConnecting();

}
 
开发者ID:dainesch,项目名称:HueSense,代码行数:35,代码来源:Launcher.java

示例14: display

import javafx.stage.Stage; //导入方法依赖的package包/类
public static void display(String title, String message)
{
	Stage window= new Stage();
	window.initModality(Modality.APPLICATION_MODAL);
	window.setAlwaysOnTop(true);
	window.getIcons().add(new Image("/pic/slogo.png"));
	window.setTitle(title);
	Label label= new Label();
	label.setText(message);
	label.setStyle("-fx-font-size:14px;");
	
	ImageView imageView = new ImageView(ICON);
	imageView.setFitWidth(40);
	imageView.setFitHeight(40);
       Label labelimage = new Label("",imageView);
	
	// two buttons
	Button okbtn= new Button("Ok");
	okbtn.setOnAction(e -> {
		answer= false;
		window.close();
	});
	okbtn.setId("blue");
	HBox hbox= new HBox(10);
	hbox.setAlignment(Pos.CENTER_LEFT);
	hbox.setPadding(new Insets(10,5,10,5));
	hbox.getChildren().addAll(labelimage,label);
	VBox layout= new VBox(15);
	layout.setAlignment(Pos.CENTER_RIGHT);
	layout.setPadding(new Insets(10,5,10,5));
	layout.getChildren().addAll(hbox,okbtn);
	layout.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672);");
	Scene scene= new Scene(layout);
	window.setScene(scene);
	scene.getStylesheets().add(SuccessMessage.class.getResource("confirm.css").toExternalForm());
	window.setResizable(false);
	window.showAndWait();
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:39,代码来源:SuccessMessage.java

示例15: setupLogController

import javafx.stage.Stage; //导入方法依赖的package包/类
public static void setupLogController() {
	try {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		URL fxmlUrl = classLoader.getResource("gui/log.fxml");
		if (fxmlUrl == null) {
			OneClientLogging.logger.error("An error has occurred loading instance_creation.fxml!");
			return;
		}
		FXMLLoader fxmlLoader = new FXMLLoader();
		fxmlLoader.setLocation(fxmlUrl);
		fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
		Parent root = fxmlLoader.load(fxmlUrl.openStream());
		stage = new Stage();
		stage.setTitle("One Client - Log");
		stage.getIcons().add(new Image("images/icon.png"));
		stage.setResizable(true);
		stage.setAlwaysOnTop(false);
		stage.initOwner(Main.stage);
		stage.initModality(Modality.NONE);
		Scene scene = new Scene(root, 600, 300);
		scene.getStylesheets().add("gui/css/theme.css");
		stage.setScene(scene);
		logController = fxmlLoader.getController();
		logController.setStage(stage);
		TextAreaAppender.setTextArea(logController.logArea);
	} catch (Exception e) {
		OneClientLogging.error(e);
	}
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:30,代码来源:OneClientLogging.java


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