javafx-8

JavaFX - How to create SnapShot/Screenshot of (invisble) WebView

微笑、不失礼 提交于 2021-02-06 10:23:09
问题 I want to create a SnapShot/Screenshot/Image from a WebView in JavaFX(8). This WebView does not need to be visible (in my case). My question: Is it possible (in any way), to create a Screenshot/Image from a WebView, when the WebView is not visible (or not added to any visible container) ? See my example code, when WebView (or it's parent ScrollPane) is visible=false , the Screenshot won't work (respectively is emtpy/blank ). Example code: package test; import javafx.animation.KeyFrame; import

JavaFX - How to create SnapShot/Screenshot of (invisble) WebView

青春壹個敷衍的年華 提交于 2021-02-06 10:23:02
问题 I want to create a SnapShot/Screenshot/Image from a WebView in JavaFX(8). This WebView does not need to be visible (in my case). My question: Is it possible (in any way), to create a Screenshot/Image from a WebView, when the WebView is not visible (or not added to any visible container) ? See my example code, when WebView (or it's parent ScrollPane) is visible=false , the Screenshot won't work (respectively is emtpy/blank ). Example code: package test; import javafx.animation.KeyFrame; import

Unable to display video in webpage using javaFx Webview (video is live on the given url)

与世无争的帅哥 提交于 2021-01-29 16:27:50
问题 I am trying to display a live webpage in JavaFX Webview . Web page contains a video but that video not playing in javaFX webview . Following is the comple code i am using it also contains the live url of my webpage. I want in my JavaFX web view video should be played through displayed live web page. package webviewbrowser; import java.awt.Dimension; import java.awt.Toolkit; import java.util.List; import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx

JavaFX SceneBuilder: ClassNotFoundException when loading custom control

这一生的挚爱 提交于 2021-01-28 11:30:36
问题 I see that there are many posts about this, some slightly recent, some much older. Nonetheless, I would like to share my own experience because I am facing this issue and I cannot seem to find a solution. First of all, the context : I use Intellij IDEA Community Edition 20018.2.2 from 21st of August 2018 I use Scene Builder from GLUON, version 8.5.0 (latest as of this post) I use the JDK & JRE 64 bits version 8.181 (latest as of this post) The situation: I am writing a chat app. I have a

JavaFX GraphicsContext clearRect doesn't work with clip mask

对着背影说爱祢 提交于 2021-01-28 05:13:32
问题 The documentation for the clearRect method of GraphicsContext states that it uses the current clip, but this isn't currently working for me. Consider: GraphicsContext context = canvas.getGraphicsContext2D(); context.beginPath(); context.rect(0,0,100,100); //Set the current path to a rectangle context.stroke(); //Highlights where the current path is context.clip(); //Intersect current clip with rectangle context.fillOval(80, 80, 40, 40); //This correctly draws the oval clipped context

Howto embed font variants in JavaFX

自闭症网瘾萝莉.ら 提交于 2021-01-27 06:20:08
问题 I need to embed local .ttf files on a JavaFX project with some variants (bold, italic and so on) but the css parser seems to not support font properties in @font-face declaration: @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-Regular.ttf'); } @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-Bold.ttf'); font-weight: bold; } @font-face { font-family: 'Open Sans', sans-serif; src: url('fonts/OpenSans-ExtraBoldItalic.ttf'); font-style:

JavaFX - Bind stage size to the root node's preferred size

本小妞迷上赌 提交于 2021-01-24 11:39:49
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

JavaFX - Bind stage size to the root node's preferred size

隐身守侯 提交于 2021-01-24 11:39:47
问题 I would like to automatically adjust the width/height of a javafx.stage.Stage whenever the preferred width/height of the Scene 's root node changes. It's a small utility window (not resizable by the user) that contains multiple javafx.scene.control.TitledPane s and the window's height should increase when one of these TitledPanes is expanded (otherwise the TitlePane's content may be out of bounds). Unfortunately I could only find javafx.stage.Window.sizeToScene() , which initially sets the

MenuBar changes the background color of the scene (Java FX 8)

心已入冬 提交于 2021-01-19 09:05:47
问题 Why MenuBar changes the background color of the scene in this code sample? It should be blue but it is white. package application; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.MenuBar; import javafx.scene.layout.BorderPane; import javafx.scene.paint.Color; public class Main extends Application { @Override public void start(Stage primaryStage) { BorderPane root = new BorderPane(); Scene scene = new Scene(root,400,400);

MenuBar changes the background color of the scene (Java FX 8)

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-19 09:04:27
问题 Why MenuBar changes the background color of the scene in this code sample? It should be blue but it is white. package application; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.MenuBar; import javafx.scene.layout.BorderPane; import javafx.scene.paint.Color; public class Main extends Application { @Override public void start(Stage primaryStage) { BorderPane root = new BorderPane(); Scene scene = new Scene(root,400,400);