javafx-8

How do I display a “single bar chart” in a TableColumn of a TableView (javaFX 8)?

≡放荡痞女 提交于 2019-12-10 21:25:23
问题 Here is a screenshot: Of interest: the upper right part and the lower part. In the lower part, there is one rule selected; this rule has: 1080 total invocations, including 274 successful invocations and 84 successful empty invocations. Right now I am displaying the ratio of successful vs total, and empty vs successful. What I'd like to be able to do is scrap the ratios and instead have a single graphical bar showing the ratios of non empty successes/empty successes/failures, using the same

Playing Video in JavaFX8

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 21:23:19
问题 I am new to JavaFX and Im currently working with an application that plays a video(.MP4) at the beginning of the application, however, I cant seem to make it work! Please tell me what's wrong with my code: import java.io.File; import javafx.geometry.Pos; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.media.Media; import javafx.scene.media.MediaPlayer; import javafx.scene.media

Make Rectangle transparent

两盒软妹~` 提交于 2019-12-10 20:34:56
问题 I need to make a drawn rectangle mouse transparent, in order to see the desktop. The following code draws my rectangle. What should I add to get that ? Thanks for help public void start(Stage primaryStage) { Group group = new Group(); Rectangle rect = new Rectangle(20,20,200,200); rect.setArcHeight(15); rect.setArcWidth(15); rect.setStroke(Color.BLACK); group.getChildren().add(rect); Scene scene = new Scene(group, 300, 200); primaryStage.setScene(scene); primaryStage.show(); } 回答1: Since the

How can I rotate a label

一个人想着一个人 提交于 2019-12-10 18:37:31
问题 In JavaFX 8 I would like to specify the css to rotate a Label so that instead of the text going from left to right, it goes from bottom to top. How can I do that? 回答1: Any node can have it's rotation styled via CSS using the -fx-rotate css attribute. This is the angle of the rotation in degrees. Zero degrees is at 3 o'clock (directly to the right). Angle values are positive clockwise. Rotation is about the center. So in your code or FXML you can have: label.setStyle("vertical"); And in your

JavaFX - Why is my FileChooser giving me access to the origin Stage?

為{幸葍}努か 提交于 2019-12-10 18:23:07
问题 When i click on the button, a FileChooser is opened. However, i can for example close the Original Stage while the FileChooser is still opened, or i still can click and switch the actual window. Check the code below My questions are : 1- How can i make the FileChooser Closes when i close the main window ? 2- How can i make the main window not clickable when the FileChooser is opened ? package application; import javafx.application.Application; import javafx.event.ActionEvent; import javafx

JFX scale image up and down to parent

寵の児 提交于 2019-12-10 18:18:37
问题 I am attempting to have an ImageView that scales with its parent. I have searched through every StackOverflow post I can find on this, and here is what I've tried: taggedImage.setPreserveRatio(true); //taggedImage.fitWidthProperty().bind( // Bindings.min(imagePane.widthProperty(), imagePane.widthProperty())); //taggedImage.fitHeightProperty().bind( // Bindings.min(imagePane.heightProperty(), imagePane.heightProperty())); taggedImage.fitWidthProperty().bind(imagePane.widthProperty());

JavaFX ScrollPane - Check which components are displayed

ぃ、小莉子 提交于 2019-12-10 17:34:08
问题 I wonder whether there is a ScrollPane property in JavaFX 8 that can be used to listen on the components that are currently displayed at a given time. For example, ScrollPane has a VBox which has 8 buttons. Only 4 buttons can be seen in scrollpane. I would like a listener that gives those 4 out of 8 buttons that are displayed while the position of the scroll changes. 回答1: You can check if the Nodes visible like that: private List<Node> getVisibleNodes(ScrollPane pane) { List<Node>

Add extractor to existing ObservableList

做~自己de王妃 提交于 2019-12-10 17:29:44
问题 I have a model class ModelParent that has an observable list ObservableList<ModelChild> , where ModelChild is another model class, with it's own properties. class ModelParent { private final ObservableList<ModelChild> children = FXCollections.observableArrayList(); public ObservableList<ModelChild> getChildren() { return children; } // More properties... } In certain occasions, I want to have an extractor applied to the list - that is, to be able to be notified when the list changes, or when

How to specify a particular order of buttons in a JavaFX 8 Alert

♀尐吖头ヾ 提交于 2019-12-10 17:01:30
问题 I need to ask the user to confirm doing an action. The set of buttons of the confirmation dialog are "Yes", "No" and "Cancel". My code is below: private ButtonType askYesNoCancel(String question) { Alert alert = new Alert(AlertType.CONFIRMATION); alert.setContentText(question); alert.getButtonTypes().setAll(ButtonType.YES, ButtonType.NO, ButtonType.CANCEL); return alert.showAndWait().get(); } which gives me The problem I am facing is that regardless in what order I specify the ButtonType s

Can I keep integral tick marks even with autoranging on an Axis?

核能气质少年 提交于 2019-12-10 16:48:22
问题 I "stole" some code from here to have an AreaChart with "smooth lines" which I use in my FXML and it works: <SmoothedAreaChart fx:id="chart" legendVisible="false" title="Tree depth by line" animated="false"> <xAxis> <NumberAxis fx:id="xAxis" tickUnit="1.0" autoRanging="false" minorTickVisible="false" forceZeroInRange="false" label="Line number"/> </xAxis> <yAxis> <NumberAxis fx:id="yAxis" minorTickVisible="false" tickUnit="1.0" forceZeroInRange="true" label="Tree depth"/> </yAxis> <