资源简介

原来做了个Swing版本的聊天程序,这次用JavaFX替换了几个主要界面,在这里共享给大家,也不要大家的积分。不过希望各位如果觉得资源不错,给个好评鼓励一下。

资源截图

代码片段和文件信息

package com.demo;

/**
 * @author: XiaHui
 * @date: 2016年10月12日 下午12:53:14
 */
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.Stagestyle;
import javafx.stage.WindowEvent;

public class HideTaskBar extends Application {

@Override
public void start(final Stage stage) throws Exception {
stage.initstyle(Stagestyle.UTILITY);
stage.setScene(new Scene(new Group() 100 100));
stage.setX(0);
stage.setY(Screen.getPrimary().getBounds().getHeight() + 100);
stage.show();

Stage app = new Stage();
app.setScene(new Scene(new Group() 300 200));
app.settitle(“JavaFX隐藏任务栏“);
app.initOwner(stage);
app.initModality(Modality.APPLICATION_MODAL);
app.setOnCloseRequest(new EventHandler() {
@Override
public void handle(WindowEvent event) {
event.consume();
stage.close();
}
});

app.show();
}

public static void main(String[] args) {
launch(args);
}
}

评论

共有 条评论