javafx-8

Showing texts over the face of a Box based on the visible area on zooming in/out

谁都会走 提交于 2019-12-04 14:23:07
I have a sample 3D application (built by taking reference from the Javafx sample 3DViewer) which has a table created by laying out Boxes and Panes: The table is centered wrt (0,0,0) coordinates and camera is at -z position initially. It has the zoom-in/out based on the camera z position from the object. On zooming in/out the object's boundsInParent increases/decreases i.e. area of the face increases/decreases. So the idea is to put more text when we have more area (always confining within the face) and lesser text or no text when the face area is too less. I am able to to do that using this

JavaFX-CSS: How to “move” style of parent to a child?

妖精的绣舞 提交于 2019-12-04 13:16:30
The trigger for this was a quick experiment to solve TreeItem selection width : the requirement is to highlight only the text, not the whole tree cell. Nothing easier than that (said Frederik :) implement a custom TreeCell with a Label as graphic (and configure the label with the item as needed) remove the selection style (mostly the highlight background from the cell add the highlight style to the label Something like (a runnable example using this is at the end): public static class MyTreeCell extends TreeCell<String> { private Label label; public MyTreeCell() { getStyleClass().add("tree

Charts: How to correlate colors between charts?

試著忘記壹切 提交于 2019-12-04 12:53:32
Below is an example that has two charts visualizing the same set of data while the data are the same, their sequence differs (in rw code that would happen dynamically) Goal: show the same data with the same colors in both charts By default, colors are applied by sequence of addition of the data. Can't find any api to change those colors - most probably I'm missing something obvious, what is it? import java.util.List; import java.util.function.Supplier; import java.util.stream.Collector; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections

Swing timer alternative for JavaFX and the thread management difference

最后都变了- 提交于 2019-12-04 12:52:50
Is it safe to use Swing timer for JavaFX or there is an special alternative for Swing? What is the differnce of the thread management between JavaFX and Swing? In fact I'm interested to know the equivalents of Swing Timer , SwingUtilities.invokeLater() and invodeAndWait() for JavaFX. By the way what if we use some Swing components in the JavaFX? Should we use two parallel Timer/Threads for updating those components? jewelsea JavaFX equivalent of SwingUtilities.invokeLater() Platform.runLater(java.lang.Runnable runnable) See also JavaFx response to SwingUtilities.invokeLater . JavaFX equivalent

What is the best way to manage multithreading in JavaFX 8?

混江龙づ霸主 提交于 2019-12-04 12:43:49
问题 I'm trying to find an efficient way to influence the shape and the content of the JavaFX GUI elements, such as simple Pane , with use of multithreading. Let's say I have a simple Pane , on which I display filled Circle s at the given itervals of time, and I want to have the posibility to answer to them, e.g. by hitting the corresponding key. So far, for this purpose, I tried to use class with the implementation of Runnable interface and creation of classic Thread object in it, in order to add

TableView, setting editable cells

北战南征 提交于 2019-12-04 11:49:24
I try to make Table cells editable. I managed to do this with two Collumns that have String values in it, but I cant make this with columns that represent Integer values. Places with X is where compiler get the error: The method setCellFactory(Callback<TableColumn<DataModel,Integer>,TableCell<DataModel,Integer>>) in the type TableColumn<DataModel,Integer> is not applicable for the arguments (Callback<TableColumn<DataModel,String>,TableCell<DataModel,String>>) and places with XX is where compiler get the error: The method setOnEditCommit(EventHandler<TableColumn.CellEditEvent<DataModel,Integer>

JavaFX TableColumns' headers not aligned with cells due to vertical scrollbar

喜夏-厌秋 提交于 2019-12-04 11:34:58
after having spent the last few hours searching the web for this issue I decided that I need your help. The issue is similar to this topic: Javafx: Tableview header is not aligned with rows No answer has been provided there and also, I think, my case is slightly different: I have a properly setup TableView with reused CellFactories and CellValueFactories. Data-wise, everything works 100% the way I intended. However once I populated my table with more rows than my view can show it naturally started to show a vertical scrollbar. From that moment on (see first screenshot) the column headers weren

Display Math Formula in javaFX

久未见 提交于 2019-12-04 10:53:19
I want to know how to display math formula in a label for exemple in JavaFX. Like this picture : I want the .jar of a library and a small example in JavaFX. I already found some libraries but they are only for Swing/AWT. I tried some of them, but they don't work for me. Displaying fancy equations with Java David Gilbert Since JLaTeXMath is using the Graphics2D API for rendering, you can use FXGraphics2D to draw the output to a JavaFX Canvas . For sample code, please refer to my answer to another similar question https://stackoverflow.com/a/25037747/2592874 Just a copy from my answer to https:/

Get screen coordinates of a node in javaFX 8

故事扮演 提交于 2019-12-04 09:58:45
问题 I am developing a JavaFX application on Windows 8.1 64bit with 4GB of RAM with JDK version 8u45 64bit. I want to capture part of the screen using Robot but the problem is that I can't get the screen coordinates of the anchor pane that I want to capture and I don't want to use snapshot because the output quality is bad. Here is my code. I have seen the question in this link Getting the global coordinate of a Node in JavaFX and this one get real position of a node in javaFX and I tried every

JavaFX eats my memory?

喜欢而已 提交于 2019-12-04 08:50:42
问题 Before going frustrated about the title, I would like to clear out that I am a fresher on JavaFX UI. I have been a developer for 9 years, using Swing and currently I decided to give a try to the JavaFX. Examples on the net shows that JavaFX really can create beautiful GUIs compared to Swing. Maybe I am trying to create and deploy GUIs the wrong way, but one thing is for sure. JavaFX panes load slower than Swing and consumes a lot more memory. The same GUI was redesigned with JAVAFX and it