javafx-2

TableCell not applied consistently

旧城冷巷雨未停 提交于 2020-01-06 14:54:05
问题 When running the program below, the TableCell is not applied (the numbers are left aligned instead of right aligned). Clicking on the "Change Values" button corrects the alignment. Using jdk1.8.0-ea-b114 Am I missing anything obvious or is it a bug? import java.util.Arrays; import javafx.application.Application; import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control

Disabling Button while TextFields empty not working

亡梦爱人 提交于 2020-01-06 14:16:12
问题 BooleanBinding bb = new BooleanBinding() { { super.bind(addnum.textProperty(),addt1.textProperty(),addt2.textProperty(), addt3.textProperty(),addasg.textProperty(),addatt.textProperty()); } @Override protected boolean computeValue() { return (addnum.getText().isEmpty() && addt1.getText().isEmpty() && addt2.getText().isEmpty() && addt3.getText().isEmpty() && addasg.getText().isEmpty() && addatt.getText().isEmpty()); } }; final Button b2 = new Button("Add"); b2.disableProperty().bind(bb); This

How to get data in one Java FXML Controller from another FXML Controller (these controllers are not nested controllers)? [duplicate]

妖精的绣舞 提交于 2020-01-06 14:00:16
问题 This question already has an answer here : How can I use a variable from another Controller in JavaFX (1 answer) Closed 6 years ago . I have one button in one FXML and two text fields in another FXML. These two FXMLs are independent, I mean they are not nested. I want to print the text (which are in the two text fields) in the console/output whenever there is a click in the button. Below are the fxmls and their controllers: Button.fxml <AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth=

How to get data in one Java FXML Controller from another FXML Controller (these controllers are not nested controllers)? [duplicate]

前提是你 提交于 2020-01-06 13:59:49
问题 This question already has an answer here : How can I use a variable from another Controller in JavaFX (1 answer) Closed 6 years ago . I have one button in one FXML and two text fields in another FXML. These two FXMLs are independent, I mean they are not nested. I want to print the text (which are in the two text fields) in the console/output whenever there is a click in the button. Below are the fxmls and their controllers: Button.fxml <AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth=

How to get data in one Java FXML Controller from another FXML Controller (these controllers are not nested controllers)? [duplicate]

巧了我就是萌 提交于 2020-01-06 13:59:37
问题 This question already has an answer here : How can I use a variable from another Controller in JavaFX (1 answer) Closed 6 years ago . I have one button in one FXML and two text fields in another FXML. These two FXMLs are independent, I mean they are not nested. I want to print the text (which are in the two text fields) in the console/output whenever there is a click in the button. Below are the fxmls and their controllers: Button.fxml <AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth=

JavaFX java.lang.IllegalStateException (Stage)

只愿长相守 提交于 2020-01-06 09:07:10
问题 I am having some problem here. This is my code for the first screen: myps.initStyle(StageStyle.UNDECORATED); // I am trying to create a splash screen look a like Now I am trying to get my borders and titles all back so I do something like this: // Exiting splash screen myps.hide(); myps.initStyle(StageStyle.DECORATED); // (Problem line) With the thoughts of hide() is going to set my stage visibility to invisible, but the problem line gives me this error: Cannot set style once stage has been

Collision detector in javafx (2d maze)

血红的双手。 提交于 2020-01-06 08:07:21
问题 How do I make my ball bounce off objects on the screen? The picture below is a good example of how the program should be working once the ball runs into an obstacle. I made the ball bounce off the walls, but what's left is making it also bounce off objects. Thanks for the help! Here's the source code: public class 2DGAME extends Application { public static Circle circle; public static Pane canvas; private long counter = 0; double X = 0; double Y = 0; @Override public void start(Stage

JavaFx adding a text label on top of StackedBarChart

烈酒焚心 提交于 2020-01-05 08:40:57
问题 After Search I found this sample how to display bar value on top of bar javafx, But that when bar separated on the category axis so each category data has a single bar and Listener can be added to that data (Category). But with StackedBarChart each category consists of StackedBar. I try that code simple based on the @jewelsea code. That solution work prefect if all series are symmetric and contain all the categories. But with non-symmetric series ObservableList<StackedBarChart.Series>

JavaFX Change text under Progress Indicator (default: Done)

房东的猫 提交于 2020-01-05 08:02:09
问题 how can I change default text "Done" under ProgressIndicator in JavaFX? 回答1: This is a little bit tricky but it is possible: In JavaFX 2.2 this is made like this: ProgressIndicator indicator = new ProgressIndicator(); ProgressIndicatorSkin indicatorSkin = new ProgressIndicatorSkin(indicator); final Text text = (Text) indicatorSkin.lookup(".percentage"); indicator.progressProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> ov,

Classpath on JavaFX using javafxpackager

て烟熏妆下的殇ゞ 提交于 2020-01-05 07:24:31
问题 I'm new to JavaFX and I'm trying to build my first application, using Maven. Well, since I don't really like to mix ant with maven, I got an alternative solution, using exec-maven-plugin and javafxpackager , found here: http://www.oracle.com/technetwork/articles/java/enterprisefxpt3-1735081.html Problem is, I don't like the way it unpacks all my dependencies inside the jar, so I modified it a "little", resulting on this: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www