zoukankan      html  css  js  c++  java
  • JavaFX学习:Stage的模式

    代码示例

    public class Main extends Application {
        @Override
        public void start(Stage primaryStage) throws Exception {
    
            /*
                DECORATED   普通背景有装饰
                    Defines a normal Stage style with a solid white background and platform decorations.
    
                TRANSPARENT   透明背景无装饰
                    Defines a Stage style with a transparent background and no decorations.
    
                UNDECORATED   纯白背景无装饰
                    Defines a Stage style with a solid white background and no decorations.
    
                UNIFIED   用平台装饰定义舞台风格,消除客户区和装饰之间的边界
                    Defines a Stage style with platform decorations and eliminates the border between client area and decorations.
    
                UTILITY   定义一个舞台样式,它具有纯白色背景和用于工具窗口的最小平台装饰
                    Defines a Stage style with a solid white background and minimal platform decorations used for a utility window.
             */
    
            Stage s1 = new Stage();
            s1.setTitle("s1");
            s1.initStyle(StageStyle.DECORATED);  // 初始化 Stage 类型
            s1.show();
    
            Stage s2 = new Stage();
            s2.setTitle("s2");
            s2.initStyle(StageStyle.TRANSPARENT);
            s2.show();
    
            Stage s3 = new Stage();
            s3.setTitle("s3");
            s3.initStyle(StageStyle.UNDECORATED);
            s3.show();
    
            Stage s4 = new Stage();
            s4.setTitle("s4");
            s4.initStyle(StageStyle.UNIFIED);
            s4.show();
    
            Stage s5 = new Stage();
            s5.setTitle("s5");
            s5.initStyle(StageStyle.UTILITY);
            s5.show();
    
            Thread.sleep(10000);
            Platform.exit(); // 退出所有窗口
        }
    
        public static void main(String[] args) {
            launch(args);
        }
    }
    
  • 相关阅读:
    让你的网站在移动端健步如飞
    select元素javascript常用操作 转
    网站CSS写在html里面的好处
    Javascript 严格模式详解
    mac下网页中文字体优化
    js作用域相关知识总结
    【待填坑】 undefined和not defined的区别
    【待填坑】js构造函数和内置对象的区别
    echarts入门1【柱状图/饼图】
    echarts在miniUI和ajax下动态渲染数据
  • 原文地址:https://www.cnblogs.com/wbyixx/p/14207690.html
Copyright © 2011-2022 走看看