javafx-8

How to convert a MeshView to a CSG object using JCSG library in JavaFX

走远了吗. 提交于 2019-12-10 07:04:21
问题 I'm using the JCSG library for JavaFX. I have some MeshView objects that I want to convert them into CSG objects, is there a way to achieve this? 回答1: The easiest way to combine a javafx.scene.shape.Mesh object with a CSG one, providing you have a TriangleMesh is converting the triangular faces to polygons ( eu.mihosoft.vrl.v3d.Polygon ). Once you have a CSG object you can perform the regular operations on it, and then you can export it back to a MeshView for instance. The problem with

Should we use FXML in JavaFX custom controls or not?

£可爱£侵袭症+ 提交于 2019-12-10 03:16:54
问题 It seems wired to ask this, I would think that using FXML to write our custom components is the obviously the right way to go. But as we can see from ControlsFX, JFXextras and even the book 'Mastering JavaFX8 controls do not use or mention the use of FXML in custom controls. Despite that, the official documentation to say to go on that route, and create JavaFX controls via FXML. What is the more correct way and why ? 回答1: There are two kinds of custom controls in JavaFX: fx:root based custom

Loading custom font using JavaFX 8 and css

北慕城南 提交于 2019-12-10 02:23:27
问题 The Problem I'm creating a Super Mario themed css style sheet for my application, and I want to change the font of my buttons to a custom font called Press Start 2P, which is the pixelated font used in the NES Mario games. However, my application's not loading the font for some odd reason. CSS code: .text { -fx-font-family: "Press-Start-2P"; } .button { -fx-background-color: transparent; //-fx-text-fill: rgb(255, 255, 255); } @font-face { font-family: Press-Start-2P; src: url("PressStart2P

How to show ProgressIndicator in center of Pane in Javafx

一世执手 提交于 2019-12-09 10:51:39
问题 I have a Pane with some controls and a button. When I click on the button, I want show ProgressIndicator in center of pane without removing any controls. When I am adding a ProgressIndicator to pane during onAction of button, it adds it below the button. I want it to overlay on the pane. The picture below explains what I want. Code package fx; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Pos; import javafx

How to change the tab pane style

╄→гoц情女王★ 提交于 2019-12-09 06:38:33
问题 I use the default JavaFX tab pane layout I want to display new tabs below the old ones. I don't want to display the default context menu to select which tab to display. Are there any options to change this? 回答1: try this....change it according your need.this is default css for tab pane and their layout... i used it and work sucessfully .tab-pane { -fx-skin: "com.sun.javafx.scene.control.skin.TabPaneSkin"; /* -fx-tab-min-width: 4.583em; 55 */ /* -fx-tab-max-width: 4.583em; 55 */ -fx-tab-min

JavaFX 8 - How to build EXE with Maven & INNO

Deadly 提交于 2019-12-09 04:24:53
问题 I have not been able to successfully find a working solution on how to configure Maven to build an EXE from JavaFX with Maven. Projects set up with E(fx)clipse using the build.fxbuild work great, however I would prefer to have a maven project, with dependent modules rather the basic ANT builds. I have seen some comments on ZENJAVA - but it appears that plug in has lost all traction and is pretty much dead. Is there anything out there that can bundle an EXE from Maven? My project is an

JavaFX - How to delete a specific Node from an AnchorPane

痴心易碎 提交于 2019-12-09 02:51:13
问题 I'm using SceneBuilder 8.0.0 and JavaFX 8. I have a Button btn and a Label lbl attached to an AnchorPane ap . When the application starts, btn and lbl are attached to ap . How can i delete one of these nodes ? (i only know clear() method which deletes all the nodes from ap ). thanks. 回答1: In JavaFX, nodes can simply be removed from a Parent (e.g. an AnchorPane) using .getChildren() following by .remove(Object o) Reference So if you have a direct reference to these Nodes, you could use the

Using JavaFX controller without FXML

℡╲_俬逩灬. 提交于 2019-12-08 23:12:29
问题 Is there a possibility to use a controller with a JavaFX GUI without using FXML. I noticed that the FXML file contains an fx-controller attribute to bind the controller but i don't find it an easy way to work with it. Any ideas about have an MVC arch with JavaFX without using the FXML file or JavaFX Scene Builder ? 回答1: Your question isn't particularly clear to me: you just create the classes and basically tie everything together with listeners. I don't know if this helps, but here is a

How to allow MouseEvents to be dispatched to disabled Nodes?

爱⌒轻易说出口 提交于 2019-12-08 21:56:04
问题 In fx, mouseEvents aren't dispatched to disabled nodes, at the end is a quick example demonstrating the behaviour. For a Swinger like me, that's a bit surprising: in my land, events are delivered and it's the task of the target (ui-delegate) to decide whether or not the event should be handled. Actually was pointed to this by a recent - perfectly valid, IMO - use-case of showing a tooltip over a disabled component Technically, the dispatch seems to be cut off in one of Node's impl methods: /*

How to display HTML in JavaFX Application

吃可爱长大的小学妹 提交于 2019-12-08 21:16:04
问题 I am developing a FontViewer application which changes the font of the text based on the selected font style. This is the controller class of my application public class FXMLDocumentController implements Initializable { @FXML private ListView fontListView; @FXML private TextArea fontTextArea; int[] fontSizes = {34, 28, 24, 20, 18, 16, 14, 12, 11, 10, 9, 8, 7, 6}; String fontText = ""; @Override public void initialize(URL url, ResourceBundle rb) { ObservableList<String> fontsList =