javafx

mapping nested object from fxml to object

不羁岁月 提交于 2020-01-25 07:56:22
问题 I created the following object which should be responsible for displaying a steeringwheel in my win app. @DefaultProperty("children") public class SteeringWheel extends Region { @FXML private Circle backgroundCircle; @FXML private Circle innerCircle; @FXML private Label mylabel; public ObservableList<Node> getChildren() { return super.getChildren(); } public void setCirclesLocations() { double centerPointX = getWidth() / 2; double centerPointY = getHeight() / 2; setCircleLocation

Refreshing a column of comboboxes in a table view, javafx

喜夏-厌秋 提交于 2020-01-25 07:39:06
问题 so i have a table view with 3 columns and one of them is a column of comboboxes, the way i create the column of combobox is as so Source = new TableColumn<>("Configure Interface as.."); Source.setCellValueFactory(i -> { final StringProperty value = i.getValue().optionProperty(); // binding to constant value return Bindings.createObjectBinding(() -> value); }); Source.setCellFactory(col -> { TableCell<TableViewTest, StringProperty> c = new TableCell<>(); ComboBox<String> comboBox = new

How to get data from Tab in Tabpane JavaFX

那年仲夏 提交于 2020-01-25 07:25:06
问题 I want get data from Tab in Tabpane JavaFX I have 2 Tab in Tabpane, And each Tab I have a TextArea, I want click Button will get data from 2 tab Here's my code: btnThem.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { try { i++; FXMLLoader fxmlLoader = new FXMLLoader( getClass().getResource("/fxml/tab.fxml")); Parent parent = (Parent) fxmlLoader.load(); Tab tab = new Tab("Điểm " + i); tab.setContent(parent); tab.setClosable(true); tabPane.getTabs

Using CcontrolsFX's SpreadsheetView in Java 9

穿精又带淫゛_ 提交于 2020-01-25 07:22:06
问题 I've got an application written in Java 8 with ControlsFX 8.40.14. I run the app under Java 9 (jdk-9.0.1 to be precise) and I got the following exception when the app tries to display SpreadsheetView component. Exception in thread "JavaFX Application Thread" java.lang.NoSuchMethodError: javafx.scene.control.TableColumn.impl_setReorderable(Z)V at org.controlsfx.control.spreadsheet.SpreadsheetView.getTableColumn(SpreadsheetView.java:2216) at org.controlsfx.control.spreadsheet.SpreadsheetView

My messagebox does not work in this GridPane

时间秒杀一切 提交于 2020-01-25 06:50:33
问题 I am taking a GridPane example from an book. The book is not the most recent. When I try to use the Internet I keep getting Scene Builder which is not what I want to use. I am using NetBeans IDE 8.2, and I have 2 problems with this program. Within the btnOk_Click() I am trying to choose Small, Medium, Large AND Thin, Thick . The program puts them in the same group. Also, this MessageBox.show(msg, "Order Details"); //????? may be out dated. The btnCancel_Click() works, but the btnOk_Click()

JavaFX Multiple Controllers at the Same Time

て烟熏妆下的殇ゞ 提交于 2020-01-25 06:50:10
问题 I'm working on a JavaFX application and have run into the following problem while making the kind of "dashboard" of my app. The structure of the application is as follows: This is the menu or "dashboard" which is kind of the main controller. The issue I'm running into is being able to send commands from the 'control panel' to the main view. the fx:ids of appFrame and controlPanel are where these views are being displayed. How can I get these two panels (each with their own controller) to

Is it possible to make a ImageView in JavaFX responsive?

♀尐吖头ヾ 提交于 2020-01-25 06:48:27
问题 me and some friends are having a project, where we try to programm a game in JavaFX. We´ve got a GridPane, thats growing with ImageViews inside to hold the map and the game character, etc. (The game character and enemies will have their own imageview, that we can move around in the gridpane.) So, our problem now is, that we want out pictures to get bigger, when the window is getting bigger also, but right now only the columns of the GridPane are getting more distance to each other. I tried to

Running java runnable JAR

痴心易碎 提交于 2020-01-25 06:39:19
问题 I have created JavaFX app with OpenJDK13 and OpenJFX13. In Eclipse I have made Runnable JAR but it doesn't work (at least on my Win 10 installation) unless I add VM arguments in command line. So, to fix this I made *.bat file with text: java -jar --module-path "C:\Java\javafx-sdk-13.0.1\lib" --add-modules javafx.controls,javafx.fxml Testing.jar It working that way. But, there is 2 things about my solution I would like to change. Is there any way to avoid Command prompt being shown when

Suming a specific TableView column/row in JavaFX

巧了我就是萌 提交于 2020-01-25 06:21:28
问题 I have done this in java where I sum the values of the price column/row. But I am wondering how to do this in JavaFX. I want to sum everything in column 1 and display it in a inputField , I used this to do it in java but how do you do this in JavaFX? tableview.getValueAt(i, 1).toString(); Here is what I'm trying to do: int sum = 0; for (int i = 0; i < tableview.getItems().size(); i++) { sum = sum + Integer.parseInt(tableview.getValueAt(i, 1).toString()); } sumTextField.setText(String.valueOf

Suming a specific TableView column/row in JavaFX

ⅰ亾dé卋堺 提交于 2020-01-25 06:21:11
问题 I have done this in java where I sum the values of the price column/row. But I am wondering how to do this in JavaFX. I want to sum everything in column 1 and display it in a inputField , I used this to do it in java but how do you do this in JavaFX? tableview.getValueAt(i, 1).toString(); Here is what I'm trying to do: int sum = 0; for (int i = 0; i < tableview.getItems().size(); i++) { sum = sum + Integer.parseInt(tableview.getValueAt(i, 1).toString()); } sumTextField.setText(String.valueOf