scenebuilder

JavaFX Scale Elements to Screen Resolution

故事扮演 提交于 2020-01-06 01:46:15
问题 I've created a GUI in JavaFX using SceneBuilder that works perfectly in windowed mode. It looks like this; What I would like to do is run the program maximised (not full screen) and ideally have the elements resize according to whether the stage is maximised or not. This is what the GUI looks like when the program is maximised; As you can see for some bizzare reason the table does "scale" however none of the other elements do. Is there a setting in SceneBuilder I can use that makes the

JavaFX coordinate system defaults to YUp

[亡魂溺海] 提交于 2020-01-05 05:50:15
问题 In my JavaFX Application, I use SceneBuilder by Gluon. The preview for the scene has a coordinate system of Y Down (Y increases downwards). However, when I import the fxml file into Java, the coordinates are all flipped. Here are the relevant screenshots. Here is the Java export: And here is the SceneBuilder preview: From what I have gathered from extensive Googling, the JavaFX coordinate system should be Y-Down, not Y-Up. Is there something wrong with my version of JavaFX? I'm on Mac OS X 10

JavaFX SceneBuilder ImageView not working

南笙酒味 提交于 2020-01-04 13:38:40
问题 I need to create a GUI with SceneBuilder. I added an ImageView to my interface and set the path to my image correctly. The image is showing inside SceneBuilder, but when I run my application, the image is not there. I put the image inside "img/placeholder.png", and then directly into my root directory. Doesn't matter where I put it, it isn't working. The path to my gui.fxml file: /src/gui/gui.fxml The path to my image file: /placeholder.png Can anybody help me please? 回答1: Another solution in

JavaFX SceneBuilder ImageView not working

混江龙づ霸主 提交于 2020-01-04 13:38:28
问题 I need to create a GUI with SceneBuilder. I added an ImageView to my interface and set the path to my image correctly. The image is showing inside SceneBuilder, but when I run my application, the image is not there. I put the image inside "img/placeholder.png", and then directly into my root directory. Doesn't matter where I put it, it isn't working. The path to my gui.fxml file: /src/gui/gui.fxml The path to my image file: /placeholder.png Can anybody help me please? 回答1: Another solution in

SceneBuilder 2: Do controller classes need to necessarily be in the same folder as the view FXML files?

萝らか妹 提交于 2020-01-01 05:49:29
问题 I'm loving JavaFX and SceneBuilder, but I just can't figure out how to make SceneBuilder link my FXML views with their Java controllers when they are not in the same folder. I'd just like to have this folder structure: package |-- model |-- view | |--someElementView.fxml | \--anotherElementView.fxml \-- control |--someElementController.java \--anotherElementController.java Instead I can only make SceneBuilder recognise my controllers if I have this folder structure which I'd like to avoid:

JavaFX using Gluon SceneBuilder InvocationTargetException

本小妞迷上赌 提交于 2019-12-31 05:12:11
问题 I was making an application for a buddy of mine and finished the design for the login screen and saved it in eclipse. This is a .fxml file by the way, and it throws an InvocationTargetException whenever I try to run the main method. Here's the stack trace: Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect

JavaFX - Can't add the Scene Builder to Intellij idea 2016

[亡魂溺海] 提交于 2019-12-25 05:09:53
问题 I'm trying to add Scene Builder to Intellij idea 2016 by following this answer but I just see this: my current solution is by opening it in standalone Scene Builder. 回答1: IntelliJ built-in Scene Builder uses the standalone Scene Builder you have installed in your machine by scanning its Java folder, looking for the dist.jar . It is recommended having the latest version of Scene Builder installed. I've just tried IntelliJ 2016.1.1 with Gluon's Scene Builder 8.1.1 and it works normally, given

Autosize text area into tabpane in javaFX

假如想象 提交于 2019-12-25 01:56:08
问题 I hava 3 tabs in a TabPane that each one has a text area with different texts and different length. I want to autosize text area according to it's length in each tab. I don't understand what should I do ? using scene builder ? css ?javaFX methods ? Thank's in Advance ... 回答1: I think you are asking that the text areas grow or shrink according to the text that is displayed in them? If so, see if this code helps: import java.util.concurrent.Callable; import javafx.application.Application;

How to stop JavaFx Slider controls from resetting to their default values when switching between windows

我的未来我决定 提交于 2019-12-24 20:32:53
问题 I have a bunch of fxml windows that I built in SceneBuilder for javafx. When I switch between my settings window and my main menu the sliders (for various sound levels) reset to their original value, however i would want them to keep the values they were at last time the window was open. I've tried settings values in initialise and settings a variable through the class that is changed and used to set the sliders when it is launched, but that didn't work either. The FXML <!-- The slider code

JavaFx optional parameters for controller class in start method when it is loaded into the FXML

跟風遠走 提交于 2019-12-24 19:00:23
问题 with the ScheneBuilder I defined the controller class of my fxml, the code genereted inside my AnchorPane tag is: fx:controller="demo.SplashController" now I would like if I had args in the main, to load a new version of the controller, using the appropriate construct. I try this code in the Application.start: FXMLLoader loader = new FXMLLoader(getClass().getResource("page.fxml")); PageController controller; if(!dir.equals("")){ //attribute coming from args controller = new PageController(dir