直接顯示:
import org.bytedeco.javacv.CanvasFrame;
黃彥霖 發表在 痞客邦 留言(0) 人氣(1,354)
Java 客戶端
import java.io.BufferedReader;
黃彥霖 發表在 痞客邦 留言(0) 人氣(3,134)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
黃彥霖 發表在 痞客邦 留言(0) 人氣(701)
package test;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.stage.Stage;
import javafx.util.Duration;
黃彥霖 發表在 痞客邦 留言(0) 人氣(1,040)
Sardine 下載 : https://github.com/lookfirst/sardine
Sardine Wiki : https://github.com/lookfirst/sardine/wiki/UsageGuide
Commons IO 的 FileUtils 下載 : http://commons.apache.org/proper/commons-io/download_io.cgi
FileUtils 教學:http://snkcxy.iteye.com/blog/1845862
import com.github.sardine.DavResource;
import com.github.sardine.Sardine;
import com.github.sardine.SardineFactory;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.apache.commons.io.FileUtils;
黃彥霖 發表在 痞客邦 留言(0) 人氣(767)
http://www.softicons.com/game-icons/super-mario-icons-by-sandro-pereira
https://colorlib.com/wp/free-flat-social-media-icons-sets/
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Test extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Load Image");
StackPane sp = new StackPane();
// Image img = new Image("file:///home/loli/B.jpg");
Image img = new Image(Test.class.getResourceAsStream("A.png"));
ImageView imgView = new ImageView(img);
imgView.setFitHeight(32);
imgView.setFitWidth(32);
Scene scene = new Scene(sp);
primaryStage.setScene(scene);
primaryStage.show();
Button button3 = new Button("Accept", imgView);
sp.getChildren().add(button3);
button3.setOnAction((ActionEvent event) -> {
System.out.println("ok");
});
}
}
黃彥霖 發表在 痞客邦 留言(0) 人氣(589)

說明:按下 [ ~ 開新視窗 ~ ] 按鈕,就會跳出一個新視窗
預覽:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
黃彥霖 發表在 痞客邦 留言(1) 人氣(2,182)
import java.io.File;
import java.io.IOException;
黃彥霖 發表在 痞客邦 留言(0) 人氣(8,378)

預覽:
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
黃彥霖 發表在 痞客邦 留言(0) 人氣(2,700)
官方文檔:https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html
<專案路徑>/WEB-INF/web.xml
以下供參考:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<!-- session-config ==================================================== -->
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<!-- error-page ======================================================== -->
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
<!-- filter ============================================================ -->
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>http://localhost:8080</param-value>
<param-value>http://127.0.0.1:8080</param-value>
</init-param>
<init-param>
<param-name>cors.allowed.methods</param-name>
<param-value>GET,POST</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
黃彥霖 發表在 痞客邦 留言(0) 人氣(1,671)