zoukankan      html  css  js  c++  java
  • javafx点击鼠标出现弹窗,demo

    在学习javafx的过程中,不知道怎么出现一个弹窗,如,点击一个按钮出现一个修改信息的列表选项

    终于在javafx文档示例中发现了类似的东西,记录一下,备忘
    package demo9_button;

    import javafx.application.Application;
    import static javafx.application.Application.launch;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;


    public class Test extends Application {
        
        @Override
        public void start(Stage primaryStage) {
            //button一个----------------------------------   
           final Button b2 = new Button("  O K  ");
            
            b2.setOnAction(new EventHandler<ActionEvent>() {//鼠标点击
                public void handle(ActionEvent e) {
                       Stage stage = new Stage();
                       Label l = new Label("显示出来了");
                       Scene s = new Scene(l,200,100);
                       stage.setScene(s);
                       stage.show();
                }
            });
            StackPane root = new StackPane();
            root.getChildren().add(b2);
            
            Scene scene = new Scene(root, 500, 350);
            
            primaryStage.setTitle("Hello World!");
            primaryStage.setScene(scene);
            primaryStage.show();
        }
        public static void main(String[] args) {
            launch(args);
        }
    }

  • 相关阅读:
    C++ version the delaunay triangulation
    Jason Saragih's Homepage
    asm/aam links
    自动白平衡算法效果图
    What algorithm to use to normalize someone's face on image
    神奇的图像处理算法
    计算机视觉牛人博客和代码汇总
    雅虎开源色情图片检测神经网络
    蚁群算法
    时间序列分析
  • 原文地址:https://www.cnblogs.com/xiaoliu66007/p/3314046.html
Copyright © 2011-2022 走看看