javafx-8

Implementing Undo/Redo in JavaFX

一个人想着一个人 提交于 2019-12-07 15:42:51
问题 I'm trying to implement undo/redo in JavaFX - I draw all my shapes using graphicsContext() . I have looked around and found that there's a save method on Graphics Context but it just saves attributes and not the actual shape/state of the canvas. What would be the best way of going about this? This is one of my code snippets when I create a circle, for instance: public CircleDraw(Canvas canvas, Scene scene, BorderPane borderPane) { this.borderPane = borderPane; this.scene = scene; this

com.gluonhq.charm.glisten.control.TextField does not exist

吃可爱长大的小学妹 提交于 2019-12-07 15:29:12
问题 I'm using scene builder to create an user interface which uses com.gluonhq.charm.glisten.control.TextField . It works properly in the Scene Builder and it's preview. But in the NetBeans editor I get the class does not exist error. When I try to run the application, I get the following runtime error. Caused by: java.lang.ClassNotFoundException: com.gluonhq.charm.glisten.control.TextField at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass

JavaFX in commercial products [closed]

最后都变了- 提交于 2019-12-07 14:41:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I want to use JavaFX as a development framework into large commercial product. Can I close the source code of my future product without violation of Oracle's license and sell my product with Oracle JavaFX framework? Are there any license restrictions? 回答1: Actually, this question, is a dublicate of FAQs

Layout with overlaying nodes and anchor-like positioning

为君一笑 提交于 2019-12-07 13:28:30
I try to make a layout with JavaFX that allows overlaying nodes, resizing them to match (fill) container size and aligning them to container sides. Which layout pane should I use and how to set it to achieve the layout shown on the picture. I tried to put TreeView node and SwingNode in an AnchorPane and setting anchors to fill the container, like that TreeView: top 0, left 0, bottom 0 (no right anchor to let is resize to fit content) SwingNode: all to 0 TreeView was displayed correctly but underlaying SwingNode didn't fit to the whole container. It looked like its right anchor was applied to

Running JavaFX applications on Redhat 5

☆樱花仙子☆ 提交于 2019-12-07 13:22:59
问题 From my previous question, I know that JavaFX is not supported in RedHat 5.8 meaning, even when I have Java 8 (jdk1.8.0_05) installed on my Linux, a JAR file created in win7 can't be executed via java -jar helloworld.jar . Does that mean there is NO way to run JavaFX jars on this machine? 回答1: The problem with running JavaFX applications on RHEL5 is the version of glib that comes with that OS is not new enough. The trick, then, is to provide a newer version of that library and all of the

Setting a tooltip on all table cells in JavaFX

懵懂的女人 提交于 2019-12-07 13:13:28
问题 My application contains a TableView . Depending on the value of a specific cell in each row, the row style is changed by setting a custom cell factory with setCellFactory for this column. This works fine. Now I'd like to add a tooltip which is no big deal using setTooltip() . However this tooltip shall be set for every cell in the table, not just the column it is specified for. How can I implement this? 回答1: Once the table is set up (i.e. the columns are created and added, and the cell

How to smooth drag a JavaFX polygon?

被刻印的时光 ゝ 提交于 2019-12-07 12:49:55
问题 I have a polygon (triangle shape). I want to make it draggable with mouse. Below is the code that I tried, but with this code I am not able to drag it smoothly. Please let me know how can I achieved to make it draggable smoothly. public void start(Stage primaryStage) throws Exception { AnchorPane pane = new AnchorPane(); final Polygon polygon = new Polygon(); polygon.getPoints().addAll(new Double[]{ 50.0, 50.0, 30.0, 70.0, 70.0, 70.0 }); pane.getChildren().add(polygon); Scene scene = new

JavaFX custom Fonts

坚强是说给别人听的谎言 提交于 2019-12-07 12:35:13
问题 Actually searched everywhere but any answer can't help me, sohere's the problem: I want to add a custom font to my buttons. I already tried to write a css java class and a lot of other solutions, but nothing helped my. /code deleted/ I'd be so glad if anyone could help me! Update: I tried this: package view; import ... public class SceneStyle { ImageView header = new ImageView("/view/images/header.jpg"); ImageView chatImg = new ImageView("/view/images/chat_win.jpg"); //Layout Style //public

Custom Components in Scenebuilder 2.0

白昼怎懂夜的黑 提交于 2019-12-07 12:22:51
问题 In Scenebuilder 1.1, you could import an entire custom component as a whole. In 2.0, however, it is importing the component as separate pieces (Container and nodes). Since my custom component relies on being unified to work with its controller and IDs, this breaks it. Is there anything I can do as of yet? I'd really like to be able to use Java 8 and Scenebuilder 2.0 for its DatePicker. If a full stable release is right around the corner, perhaps I can wait. I'd preferably want to avoid hacky

How to crop and resize JavaFX Image?

谁说胖子不能爱 提交于 2019-12-07 12:22:35
问题 I'm trying to display very large images on JavaFX canvas. Resolution of a single image is 11980x8365. Each image has a corresponding world file and I can use it to position images correctly. My canvas size is 800x600. Sometimes I need to write whole image on the canvas, and sometimes just a part of it. Here is what I've done so far: Load full sized image from a file into the Image object. Calculate which part of Image to show and calculate scale parameters to correctly fit it into 800x600