scenebuilder

How to change the color of pane in javafx?

 ̄綄美尐妖づ 提交于 2019-12-10 01:30:11
问题 I want to change the color of a Pane which I get as a String from user. How can I set this String as a background color in my pane? Code: colorField.setOnKeyTyped(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent t) { color = colorField.getText(); } }); 回答1: If you really just want to know how to accomplish that particular thing, I'd suggest the following: Set the Nodes' CSS like this, using the hexacolor that was entered by the user: String enteredByUser = "abcdef";

Refill a SVG Path with onMouseEntered event in JavaFX

二次信任 提交于 2019-12-10 00:20:03
问题 i'm working on a personal project which includes a .fxml document(created from a .svg file with NetBeans). Here is the Map as you can see.Moreover, all the regions are converted into a SVG Path in .fxml file. The thing is i can handle with mouse events with using JavaFX Scene Builder with a controller class however, i want to refill (or in other words repaint or highlight ) the region whenever mouse is entered on it. Here is main class public class JavaFXApplication1 extends Application {

JavaFX 2.0 FXML Child Windows

一世执手 提交于 2019-12-09 13:46:23
问题 After much searching I found this question How to create a javafx 2.0 application MDI. What I really wanted to know is if I can create a pop-up window or child window to the main window using JavaFX components and Scene Builder to create the new window. I ended up with this for a modal pop-up window: In the Main class I wanted to save the primary stage to a field I can access from my primary controller class. So, I added a static variable Stage to it and this in the Main.Start() method:

JavaFX menu item show shortcuts on right hand side

怎甘沉沦 提交于 2019-12-08 17:09:25
问题 Take for example the menu items from the edit menu in JavaFX Scene Builder See how they display the shortcuts on the right? Is there any easy way to achieve the same effect using JavaFX? Thanks. 回答1: You can add an accelerator key in scene builder or add it directly in the fxml file like so <MenuItem mnemonicParsing="true" onAction="#mnuSaveAction" text="%menu.title.save" fx:id="mnuSave"> <accelerator> <KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />

Zooming an Image in ImageView (javafx)

☆樱花仙子☆ 提交于 2019-12-08 05:49:03
问题 I'm trying to zoom with a slider a selected image in ImageView. The only thing that I am able to do is to resize whole ImageView with the image in it. But this is not what i am searching for. I want to zoom only the image with ImageView having the same size. It should be a demonstration of a focal length. I'm using also scene builder.I'm only beginner in all of this, so I would really appreciate your help. Here's what I have. public void openImage(ActionEvent event) { FileChooser fc = new

Use SceneBuilder with JavaFX 11 in IDEA

我怕爱的太早我们不能终老 提交于 2019-12-08 05:15:45
问题 I am using IDEA (with OpenJDK 11), and I am trying to use the SceneBuilder to display my FXML files. It works, except when I use inherited JavaFX components, for example : public class MyLabel extends Label { public MyLabel(){ super(); setText("42"); } } I always get an error : java.lang.UnsupportedClassVersionError: sample/MyLabel has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up

JavaFX: stage's minHeight considering titlebar's height

本秂侑毒 提交于 2019-12-08 04:28:30
问题 I'm currently building a small UI application for personal purpose and I ran into a problem. Here is some code: public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("ui.fxml")); Scene scene = new Scene(root); stage.setTitle("My app"); stage.setScene(scene); stage.setMinHeight(608.0); stage.setMinWidth(1080.0); stage.show(); } And here's the FXML code assiociated with: <GridPane gridLinesVisible="true" minHeight="608.0"

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

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

JavaFX: Align Buttons inside ButtonBar (using SceneBuilder or fxml)

本小妞迷上赌 提交于 2019-12-07 06:44:50
问题 I have a JavaFX ButtonBar with two Buttons (created via SceneBuilder). I want one of the buttons to be left-aligned and the other right-aligned. (see screenshot) From the docs I already know how I could achieve this inside the java-source-code: ButtonBar.setButtonData(newButton, ButtonData.LEFT); BUT I want to know how to achieve this WITHOUT having to write this inside my java-files but how I can achieve this using just SceneBuilder or the corresponding fxml file . My .fxml file currently