确实.
只不过,相对于java语言的特色来讲,fx窗体界面还是值得怀念的.
java的一大经典特色,什么领域都要沾.
c#的winform能搞windows窗体应用程序,java的fx也能搞这个.
php能作为网站服务,java web也能作为网站服务.
html, css和javascript能在浏览器上渲染铺网页前端,想当年,java的htmlapplet标签也曾经近乎于做到了这一点,还有后来出现的jsp小脚本以及jstl标签库等亦如此.
objective-c或swift能作用在苹果移动端,java,groovy或kotlin能作用在安卓移动端.
c++通过amf3协议可以与swf文件做长连接主动推送数据,java也有amf3协议也轻松实现了这一条.
说用python可以写个 *** 数据爬虫,java也不成问题.
说matlab可以用于数学运算,结果,一些人有时候也会拿java做数学运算,毕竟java的Math库还是够大的.
说solidity的横空出世是作为以太坊的智能合约语言,而java声称自己能够和solidity完美对接.
3 billion devices run java, 这句话真不是盖的.
久而久之,java变得似乎是什么都能做,而什么都不专精.
尽管如此,fx还是长久地存在于我们的记忆里.
而且,在物联网项目中,同为长连接的协议,tcp/ip协议要比ws协议更方便地解决p2p对等 *** 通信,这时候,做一个虚拟硬件终端,可以看出来fx应用窗口软件反而比html网页好用得多.因为物联网项目和游戏项目,仍然要比web项目和web service项目复杂太多了.
直接写个 *** 吧:
private Node createCloseButton() {
closeButton = new Button("Close");
closeButton.setId("button-close");
closeButton.setOnAction(new EventHandlerActionEvent() {
@Override
public void handle(ActionEvent event) {
Platform.exit();
}
});
return closeButton;
}
private Node createMaximizeButton() {
Button maximizeButton = new Button("Maximize");
maximizeButton.setId("button-maximize");
maximizeButton.setOnAction(new EventHandlerActionEvent() {
@Override
public void handle(ActionEvent event) {
private void moveStage(MouseEvent me, Window primaryStage) {
if (maximized.get()) {
anchor.set(new Point2D(((me.getScreenX() - primaryStage.getX()) / primaryStage.getWidth()) * backupWindowBounds.get().getWidth(), me
.getScreenY() - screen.getVisualBounds().getMinY()));
primaryStage.setWidth(backupWindowBounds.get().getWidth());
primaryStage.setHeight(backupWindowBounds.get().getHeight());
maximized.set(false);
}
primaryStage.setX(me.getScreenX() - anchor.get().getX());
primaryStage.setY(me.getScreenY() - anchor.get().getY());
}
点击 ImageView 调整窗口。
Javafx几种典型的布局是FlowPane面板它采用的布局策略是,按照控件的添加次序按个摆放,按照从上到下,从左到右的次序摆放,当窗口的大小发生变化后,场景的大小也自动跟着变化,面板的大小也跟着变化,并且会重新计算各个控件的位置,重新摆放各个控件的位置,GridPane面板它采用的布局策略是,将整个面板划分为若干个格子,每个格子的大小是一样的,每个格子中可以放置一个控件,类似于表格的方式。
一般使用容器的窗口组件来完成
————————————
插入——布局 里面就可以改 06版cad有三个选项 之一个新建 输入布局名后 确认 就会以所画的图形的外轮廓为布局大小新建布局。 第二个是来自样板 那就样板文件内的布局是多大的了 第三个是创建布局向导 可以依自己的需要进行修改布局大小
private void clickShow(ActionEvent event) {
Stage stage = new Stage();
Parent root = FXMLLoader.load(
YourClassController.class.getResource("YourClass.fxml"));
stage.setScene(new Scene(root));
stage.setTitle("My modal window");
stage.initModality(Modality.WINDOW_MODAL);
stage.initOwner(
((Node)event.getSource()).getScene().getWindow() );
stage.show();
}
下面是一个实现dialog box
import javafx.stage.*; import javafx.scene.*;import javafx.scene.paint.Color;import javafx.scene.control.*;import javafx.event.ActionEvent;import javafx.event.EventHandler;public class ModalDialog {
Button btn;public ModalDialog(final Stage stg) {
btn = new Button();final Stage stage = new Stage();//Initialize the Stage with type of modalstage.initModality(Modality.APPLICATION_MODAL);//Set the owner of the Stage stage.initOwner(stg);
stage.setTitle("Top Stage With Modality");
Group root = new Group();
Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
btn.setOnAction(new EventHandlerActionEvent() {public void handle(ActionEvent event) {
stage.hide();
}
});
btn.setLayoutX(100);
btn.setLayoutY(80);
btn.setText("OK");
root.getChildren().add(btn);
stage.setScene(scene);
stage.show();
}
}import javafx.application.Application;import javafx.event.ActionEvent;import javafx.event.EventHandler;import javafx.scene.Group;import javafx.scene.Scene;import javafx.scene.control.Button;import javafx.scene.paint.Color;import javafx.stage.Stage;public class ModalTest extends Application {/**
* @param args the command line arguments
*/public static void main(String[] args) {
Application.launch(ModalTest.class, args);
}
@Overridepublic void start(final Stage primaryStage) {
primaryStage.setTitle("Hello World");
Group root = new Group();
Scene scene = new Scene(root, 500, 450, Color.LIGHTBLUE);
Button btn = new Button();
btn.setLayoutX(250);
btn.setLayoutY(240);
btn.setText("Show modal dialog");
btn.setOnAction(new EventHandlerActionEvent() {public void handle(ActionEvent event) {
ModalDialog md = new ModalDialog(primaryStage);
}
});
root.getChildren().add(btn);
primaryStage.setScene(scene);
primaryStage.show();
}
}
几点考虑 long result = -1; 进程一:预备测验脚本首要事情概述 首要,保证Windows 10现已更新至最新版别,由于咱们只在最新版别的Windows 10体...
一、在哪网络怎么找黑客 1、黑客网找主人教书。在哪网络anubis是真的吗最好的方法是阅读一些大师的杰作,并试图阅读和阅读一些东西,直到你达到你在范文中所看到的简洁和力量。黑客接单黑客最早起源于英国黑...
相比其他形式的营销,92%的消费者更信任他们的朋友、家人和同龄人的推荐。83%的美国人表示如果他们信任的人推荐一种产品或服务,那么他们购买的可能性更大。 因此,如果你正在寻找获得新客户的最佳方式...
人死之后,活着的人会选择一个好日子给死去的人下葬,但是其实下葬的日子也是很有讲究的。像是二十节气这种特殊的日子很多人会选择这天下葬,那么2020年冬至适合下葬吗?2020年冬至可以落葬吗?对这个问题感...
seo是一种职业,也是一种事情。进修seo的目标就是增加收入,许多初入搜索引擎优化行业的人都在思量seo去那边可以接外包的事情,实际上,seo外包渠道有许多,这个本不是大问题,真正的问题是本身的技能是...
中新网11月24日电 据俄罗斯卫星网报道,俄罗斯新冠疫情防控指挥部24日表示,过去24小时,俄新增新冠病毒感染病例24326例,累计感染病例超213.8万例。 资料图:当地时间10月18日...