2th Feb
【1】why Java接口作为参数传递
https://stackoverflow.com/questions/2575429/interface-as-a-method-parameter-in-java
There are many examples in the Java standard API, especially in the collections framework. For example, Collections.sort() can sort anything that implements the List interface (not just ArrayList or LinkedList, though implementing your own List is uncommon) and whose contents implement the Comparable interface (not just String or the numerical wrapper classes - and having your own class implement Comparable for that purpose is quite common).
It's not the interface "object" being passed to the method, still just a regular object. It's just a way of saying "this parameter will accept any object that supports this interface". It's equivalent to accepting some object of a base class type, even if you're passing in a subclass.
【2】 Lambda表达式:使用Lambda表达式,我们就可以不必编写FunctionalInterface
接口的实现类,从而简化代码
https://www.liaoxuefeng.com/wiki/1252599548343744/1305207799545890
【3】啥是notation
【4】var
https://www.infoq.cn/article/java-10-var-type-inference
【5】方法引用---看不懂 ---没懂
https://www.liaoxuefeng.com/wiki/1252599548343744/1305207799545890
--- foreach() 方法定义 ;
【6】Java 9 Platform Module System (JPMS)
【7】JavaFx 打包: 53
运行的时候 module path;add modules ; ===> 这些操作 的 目的 通知JPMS 构建模块依赖图;需要命令行;
简便方法: 项目里面新建一个 .java文件, 并调用 HelloApplication.main(args) 作为程序的主要入口点;
打包 jar
J-link;J-package
【8】
所以,想切换窗体的不同展示内容就很简单;
传给stage不同的scene对象就可以
branch 可以包容其它子控件的 容器控件/布局控件;
生命周期:
【1】Init() JavaFX框架自动负责启动;
【2】start()方法调用结束后,就进入运行状态 Running ;
【3】 这个时候JavaFx会启动 消息循环 ,消息循环 里面 关联着一个消息队列;
——》然后用户的所有操作,键盘操作,鼠标操作 会转换成消息——》推送到队列中;
消息循环 会时刻 监控着这个队列 ; 如果有这样的一个任务出来,就会把任务取出来执行,执行的过程中 会跟着 更新界面上的 元素/控件
消息队列,更新元素
创建 UI 控件的线程 被叫做 UI 线程; JavaFx规定 要想 访问到UI控件 ,这个代码必须在UI线程中执行;
不允许跨线程直接访问可视化控件,如果访问可视化控件,将会抛出一个异常,程序退出;
【9】 Stage 窗体
【10】
主类 帮助 实现通信;
【11】事件概述
【12】
【13】56
【56】