scenebuilder

How to add AwesomeFontFX Icon Pack to JavaFX Project in IntelliJ IDEA?

五迷三道 提交于 2020-07-09 12:57:52
问题 I am creating a mini-JavaFX project and wanted to use the Awesome Font Icon Pack.I loaded the fontawesomefx-8.9 using the Scenebuilder and opened the FXML in it and loaded two icons in it, also added the JAR file in External Libraries in IntelliJ but when I run the code it gives a ClassNotFoundException for de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView. What should I do? I removed the two Icons and the code runs fine. I searched many places but it only showed to add the JAR files to

How do I get multiple Java threads to pause and resume at a user's request?

五迷三道 提交于 2020-07-03 11:56:41
问题 I'm creating a 20-minute countdown timer application. I'm using JavaFX SceneBuilder to do this. The timer is composed of two labels (one for minutes, one for seconds--each composed of a CountdownTimer class object), and a progress bar (the timer looks like this). Each of these components are separate and running on separate threads concurrently to prevent the UI from freezing up. And it works. The problem: The three threads ( minutesThread , secondsThread , progressBarUpdaterThread ) I need

How do I get multiple Java threads to pause and resume at a user's request?

半城伤御伤魂 提交于 2020-07-03 11:56:09
问题 I'm creating a 20-minute countdown timer application. I'm using JavaFX SceneBuilder to do this. The timer is composed of two labels (one for minutes, one for seconds--each composed of a CountdownTimer class object), and a progress bar (the timer looks like this). Each of these components are separate and running on separate threads concurrently to prevent the UI from freezing up. And it works. The problem: The three threads ( minutesThread , secondsThread , progressBarUpdaterThread ) I need

Can't populate JavaFX TableView created in SceneBuilder 2

谁说胖子不能爱 提交于 2020-06-10 06:43:06
问题 I am trying to re-create the table view sample using scene builder 2, but my TableView couldn’t be populated. I defined my table in JavaFx SceneBuilder like so: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <AnchorPane id="AnchorPane" prefHeight="380.0" prefWidth="462.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller=

Make a dark mode with JavaFx

岁酱吖の 提交于 2020-02-27 09:13:56
问题 I was wondering if there is an easy way to make a dark mode using JavaFx and CSS. I have a MenuBar with a CheckMenuItem called 'Dark mode' and when I click it I want the scene to become dark and the text to become white. 回答1: Here's mine. (Update) The previous one was too opaque. .root { -fx-accent: #1e74c6; -fx-focus-color: -fx-accent; -fx-base: #373e43; -fx-control-inner-background: derive(-fx-base, 35%); -fx-control-inner-background-alt: -fx-control-inner-background ; } .label{ -fx-text

Make a dark mode with JavaFx

℡╲_俬逩灬. 提交于 2020-02-27 09:12:20
问题 I was wondering if there is an easy way to make a dark mode using JavaFx and CSS. I have a MenuBar with a CheckMenuItem called 'Dark mode' and when I click it I want the scene to become dark and the text to become white. 回答1: Here's mine. (Update) The previous one was too opaque. .root { -fx-accent: #1e74c6; -fx-focus-color: -fx-accent; -fx-base: #373e43; -fx-control-inner-background: derive(-fx-base, 35%); -fx-control-inner-background-alt: -fx-control-inner-background ; } .label{ -fx-text

JavaFx elements, change the size dynamically in relationship to the size of the window

夙愿已清 提交于 2020-01-30 08:38:27
问题 I have this: A borderPane with left node a Vbox (green arrow) with button inside(orange arrow). What I can not do is find a way to change the dimensions of Vbox(green segment) and then for the button (orange segment) in accordance with the size of the window. (when the user plays with the window size) I prefer to find a way to set the parameters into my css files, or as a last resort inside my fxml. .css file: .left-borderPane{ /*this is style class for Vbox */ /*something so similar: */ -fx

Images imported in scene builder is not getting displayed while executed in netbeans

▼魔方 西西 提交于 2020-01-24 06:47:05
问题 All the functionalities are working fine except this image display. But in Scene builder preview its working fine. Can someone help in this?? 回答1: maybe you linked images from outside the projectdirectory, i made a small and simple example, which works quite well. Put your image into the same package, where you placed your fxml file and link it again in Scene Builder to the new location. Here's a little code: App.java package com.example.images; import javafx.application.Application; import

How to automatically resize windows in JavaFx for different resolutions?

时光毁灭记忆、已成空白 提交于 2020-01-22 20:14:49
问题 I have the following problem: I have created a JavaFX window on a desktop with full hd, and I set the scene like this: Scene scene = new Scene(root,1475,1015); When I run the application on a laptop with 1360*760 resolution, I can't see the whole application and I can't resize it. How can I set my application to resize automatically in function of the desktop/laptop and it`s resolution and dimensions? 回答1: I believe you are looking for this GraphicsDevice gd = GraphicsEnvironment

Set the width of items list in ChoiceBox JavaFX

社会主义新天地 提交于 2020-01-17 08:21:27
问题 I'd like to see the list of items the same width like it's title: But actual picture is: And I haven't found any styles of ChoiceBox's item list in scene builder. Is there any style to add in css file to make items list the same width and position? Current styles: ChoiceBox { -fx-min-width: 28px; -fx-min-height: 42px; -fx-font-size: 16px; -fx-background-radius: 0; -fx-background-color: #ffffff; -fx-border-width: 1px; -fx-region-background: #000000 / -fx-mark-color: #757575; -fx-border-color: