javafx-8

JavaFX How do I scale the coordinates of a Path without altering the line width?

微笑、不失礼 提交于 2019-12-10 16:36:05
问题 I am currently working on a step line chart with a zoom and panning functionality. Since the amount of data I need to process is pretty large, i can not afford to recreate the whole path of the step line, every time layoutPlotChildren() is called. So my idea was to create the path element once and just transform it on zoom an pan events. So far everything worked out as planned, but i am having a big problem when I'm trying to scale the path. Since the Path class is inherited from Shape,

Change chart color

岁酱吖の 提交于 2019-12-10 16:09:42
问题 I tested this css code to change chart color but I get NPE when I run the code: public class MainApp extends Application { @Override public void start(Stage stage) { stage.setTitle("Line Chart Sample"); //defining the axes final NumberAxis xAxis = new NumberAxis(); final NumberAxis yAxis = new NumberAxis(); xAxis.setLabel("Number of Month"); //creating the chart final LineChart<Number,Number> lineChart = new LineChart<>(xAxis,yAxis); // Look up first series fill Node node = lineChart.lookup("

How to set/remember scrollbar thumb position in JavaFX 8 WebView?

99封情书 提交于 2019-12-10 16:09:24
问题 I have a question regarding the JavaFX 8 WebView and its scrollbars. I want to reload an HTML document and remember the current vertical scrollbar position. Unfortunately, the scrollbar moves to its initial position whenever I reload the document. How can I force the scrollbar to remember its position? My attempts to solve this problem: Via WebView#lookup(String id) (see 1) it is possible to access the vertical and horizontal ScrollBar instances of a WebView instance. This allows me to get

Java 8 SortedList TableView not refreshing

匆匆过客 提交于 2019-12-10 15:55:31
问题 I am using a TableView to visualize a SortedList backed up by an ObservableList. The comparator of the SortedList is bound to the comparator of the TableView: sortedList().comparatorProperty().bind(tableView.comparatorProperty()); The SortedList sorts as expected (by the comparator of the TableView chosen) when I add an item to the underlying ObservableList. Although when I change a Property of the ObservableList (with a CheckBoxTableCell, but that shouldn't matter), the SortedList doesn't

FXML cellValueFactory for TreeTableColumn

那年仲夏 提交于 2019-12-10 15:25:14
问题 I've been trying to build a Tree Table and define the cellValueFactories in FXML. When I try this, I get the following error in the stack trace Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: javafx.scene.control.TreeTableColumn$CellDataFeatures cannot be cast to javafx.scene.control.TableColumn$CellDataFeatures The FXML is written as follows <TreeTableView prefHeight="500.0" prefWidth="600.0" fx:id="customerContractsTable"> <columns> <TreeTableColumn prefWidth=

JavaFX 3D - How to set different cameras for Group with 3D object and SubScene with UI Controls?

主宰稳场 提交于 2019-12-10 14:53:20
问题 Due to new features in JavaFX 8, it became possible to combine 3D objects with 2D UI controls. I used this documents as manuals: JavaFX Tutorial, Exploring JavaFX 3D. So, I made this code: public class CastAnalytics extends Application { final Group root = new Group(); final Group axisGroup = new Group(); final XForm world = new XForm(); final PerspectiveCamera camera = new PerspectiveCamera(true); final PerspectiveCamera subSceneCamera = new PerspectiveCamera(false); final XForm cameraXForm

Edit item in JavaFX TreeView

北慕城南 提交于 2019-12-10 14:16:32
问题 I have this custom TreeView code: treeView.setCellFactory(new Callback<TreeView<Tree>, TreeCell<Tree>>() { @Override public TreeCell<Tree> call(TreeView<Tree> treeView) { final TreeCell<Tree> cell = new TreeCell<Tree>() { @Override protected void updateItem(Tree item, boolean empty) { super.updateItem(item, empty); if (!empty) { setText(item != null ? item.toString() : ""); setGraphic(createImageView(item)); setContextMenu(createContextMenuTreeItem(item)); } else { setText(null); setGraphic

Clojure can't import JavaFX classes with static initializers

早过忘川 提交于 2019-12-10 13:27:32
问题 I'm playing around with Clojure (1.6) and JavaFX 8, and right at the start I've run into a problem. For example, this very simple code fails: (ns xxyyzz.core) (gen-class :name "xxyyzz.core.App" :extends javafx.application.Application :prefix "app-") (defn app-start [app stage] (let [button (javafx.scene.control.Button.)])) (defn launch [] (javafx.application.Application/launch xxyyzz.core.App (into-array String []))) (defn -main [] (launch)) This is the last part of the stack trace that seems

JavaScript script in a FXML

我是研究僧i 提交于 2019-12-10 12:57:18
问题 I'm trying to run the following example from FXML reference: This example consists in declaring a String variable in a JavaScript script and using it later in the FXML with the $ operator for displaying the String in a Label. The problem is that when I run this example with Java 8u40, the Label is empty instead of showing the declared String. JavaFxComponent.java: public class JavaFxComponent extends VBox { public JavaFxComponent() throws Exception { FXMLLoader fxmlLoader = new FXMLLoader

Show Tooltip on disabled Control in JavaFX

天大地大妈咪最大 提交于 2019-12-10 12:39:43
问题 It is possible to show a Tooltip on a disabled Control? I have the following code and this doesn't work: txt_searchText.setDisable(true); txt.searchText.setTooltip(new Tooltip("Message")); Has anyone a solution for that problem? Thx 回答1: The answer is no. Currently you cannot show a tooltip on disabled Node, for the simple reason that disabled Nodes do not receive any MouseEvents. You can see the issue being raised in the official issue tracler here (require login) : https://javafx-jira.kenai