javafx

Connect TableView columns to the HashMap values

只谈情不闲聊 提交于 2019-12-25 08:52:27
问题 I'm writing a simple crud-redactor, and there is a problem I stuck on: I have a class: public class Note { List<String> columnNames; HashMap<String, SimpleStringProperty> items; } which I need to somehow connect with a TableView via setCellValueFactory . For example I have 3 values in HashMap with keys "id" , "name" and "age" . So I want to have 3 columns in TableView which are connected with this HashMap and will represent its values after wrapping an array of Notes into ObservableList and

How can I make my StackPane take up the full vertical height of the window?

此生再无相见时 提交于 2019-12-25 08:49:46
问题 I'm trying to make the StackPane located in the <left> element of my main BorderPane take up the full vertical height of the window, even when its resized. How can I do this? This is what I've got so far: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.ListView?> <?import javafx.scene.control.MenuBar?> <?import javafx.scene.control.ScrollPane?> <?import javafx.scene.control.ToolBar?> <?import javafx.scene.Group?> <?import javafx.scene.image.Image?> <?import javafx.scene

JavaFX ScrollPane setVvalue() not working as intended

左心房为你撑大大i 提交于 2019-12-25 08:29:01
问题 In my application I have a ScrollPane with a VBox that potentially contains anywhere from 0 to 1000 panes at a set height of 90 each. Each pane has related items that could loaded from a button inside that clears the VBox and adds its children along with a 'Return to Results' button that loads the previous list and should return to the same place in the ScrollPane. However, the setVvalue() doesn't appear to be working. The panes and their children are of the same class. package application;

Javafx Update a tableview from another FXML

霸气de小男生 提交于 2019-12-25 08:27:40
问题 Reference article Applying MVC With JavaFx I have interface 1 FXML the following <SplitPane> <items> <TableView prefHeight="200.0" prefWidth="200.0"> <columns> <TableColumn prefWidth="75.0" text="User" /> <TableColumn prefWidth="75.0" text="Pass" /> </columns> </TableView> <fx:include source="Container.fxml"/> </items> </SplitPane> Container.fxml it is only used to store xml interface example I used to embed InputData.fxml,Test.fxml on TabPanel And interface 3 InputData.xml I contains

Java FX out of the window screen

牧云@^-^@ 提交于 2019-12-25 08:23:36
问题 I wanna it will be okay when the number variables is changed, but when the are increased the button goes out from the window. How to fix it? Also how to put the bar down to the level of "10$", so they will be in the same row? Before : After : Here is my code : VBox vboxBottom = new VBox(); HBox hboxBottomElements = new HBox(15); HBox hboxBottomMain = new HBox(0); Region region = new Region(); region.setPrefWidth(500); hboxBottomElements.getChildren().addAll(visaLabel, separator2, adLabel,

Is it possible to placing Plugins(.appex) at a common location beforehand where JavaFX maven plugin would pick it and build the app

元气小坏坏 提交于 2019-12-25 08:14:09
问题 I am working with JavaFX Maven Plugin to build my app on OS X. During the build process , whatever lies in the app folder will be automatically placed in Java folder to the main app. Whatever lies in Info.plist and .icns will be picked up from deploy/package/macosx folder But I have still not been able to figure out the position for placing the .appex file (Finder Extensions) in order to get them placed automatically inside the Plugins folder during the build process of the main application

Graphics Context will only draw in one thread

南笙酒味 提交于 2019-12-25 08:05:38
问题 I am making a game of snake, but whenever I try to update my canvas in the draw() method, the new snake won't draw. It draws in the run thread. I have tried a bunch of different things, but I can't seem to get it working. Imports: import javafx.application.Application; import javafx.event.*; import javafx.scene.*; import javafx.stage.*; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.geometry.*; import java.io.*; import java.util.*; import javafx.scene.input

How to set the style of list view cells based on a condition in JavaFX

我们两清 提交于 2019-12-25 08:03:55
问题 I am attempting to set the style of individual cells in a list view based on a condition. The list view is of type Label, and the condition is determined based on another class when labels are inserted into the listview. Currently, I have tried to set the background colour of each label in the list view but it doesn't cover the entire area (see picture). I've also researched this article but it doesn't suit my case as the identifier for highlighting the list view cell is not carried in the

JavaFX: Retrieve a Node

自作多情 提交于 2019-12-25 07:58:38
问题 I have two FXML documents each one represents a view, let's call them View1 and View2 , and I have placed each one in a separate Tab , ( Tab1 and Tab2 ) inside a TabPane . Now in the Controller1 of View1 I have an event that will switch the selectedItem of my TabPane from Tab1 to Tab2 . My question is how can I access my TabPane from Controller1 In general. How do we retrieve a certain Node in Javafx . Edit View1 <VBox fx:controller="controllers.Controller1"> <Button onAction="#openView2"/> <

Is a singleton controller possible in JavaFX(ML)?

本小妞迷上赌 提交于 2019-12-25 07:54:03
问题 I tried to implement a controller with the singleton pattern like described a couple of times on the web. However I cant get the application to run because of the following exception. java.lang.IllegalAccessException: Class sun.reflect.misc.ReflectUtil can not access a member of class testapp.Controller with modifiers "private" I guess thats because the constructor is declared private. I dont see what I am doing wrong at this point. In case I wasn't clear what my problem is I will describe