javafx-8

How can I avoid the display of percentage values, when using the ProgressIndicator of JavaFX UI Controls

╄→尐↘猪︶ㄣ 提交于 2019-12-02 21:29:18
问题 I am pretty new to Java and would like get rid of the displayed percentage value of the ProgressIndicator in Java FX. Is there a method to disable the value display? I checked the documentation, but as far as I understand it and couldn't find the right method. Thank you for your help!! 回答1: Editing the Text value Since the Text node used for displaying the progress value is hidden in an inner class within the ProgressIndicatorSkin class, the best way to access it is using lookups, trying to

Please Explain How to Use CheckBoxTableCell

拥有回忆 提交于 2019-12-02 21:14:34
I would like to know more about how to practically use or subclass (if necessary) CheckBoxTableCell. There is one specific case I would like to use this class, whereby the check box doesn't bind to the underlying data model property. Suppose that I have a column call 'Select' that has check boxes in them. This column, more or less serve as a visual marker against the row. An user could tick these boxes and then use a button to execute some action against the ticked rows (e.g. delete all ticked rows). I've search for tutorials on this subject. Whilst there were some tutorials or explanations on

How to setEnabled() in javafx-8?

拟墨画扇 提交于 2019-12-02 20:59:05
问题 Unlike Swing Javafx-8 doesn't appear to have "setEnabled()" methods (or equivalent) for UI controls. Suggestions for workarounds? 回答1: You can use setDisable() instead of setEnabled() in javaFx.. like button.setDisable(false) setDisable is a public method for disabling a node, setDisabled is a protected method used only by internal implementations 来源: https://stackoverflow.com/questions/27831409/how-to-setenabled-in-javafx-8

JavaFX: TextArea automatic height expanding without scrollbar

三世轮回 提交于 2019-12-02 20:28:12
问题 Can I force the TextArea control to automatic expanding the height ? In the following case, I would like to see the scrollbar at ScrollPane control, not at TextArea control. <?xml version="1.0" encoding="UTF-8"?> <?import javafx.geometry.Insets?> <?import javafx.scene.control.ScrollPane?> <?import javafx.scene.control.TextArea?> <?import javafx.scene.control.TextField?> <?import javafx.scene.layout.VBox?> <ScrollPane fitToHeight="true" fitToWidth="true" maxHeight="-Infinity" maxWidth="

Scala using Java libraries, taking advantage of lambda expressions support in Java 8

随声附和 提交于 2019-12-02 19:10:29
According to: http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#lambda-expressions-in-gui-applications Previously: btn.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { System.out.println("Hello World!"); } }); Now, we can: btn.setOnAction( event -> System.out.println("Hello World!") ); Now, I try to do that in Scala when using a Java library. I'm using JavaFX (which is included by default in Java 1.8 SE). Try: chart.setOnMouseClicked( (e: MouseEvent) => println("Noice") ) However, I get: Error:(204, 46) type mismatch; found

JavaFX8: How to create listener for selection of row in Tableview?

为君一笑 提交于 2019-12-02 19:01:10
I currently have two tableviews in one screen, which results in both TableViews have rows which the user can select. Now I want only one row to be selected at the same time (doesn't matter which TableView it is selected from). I was thinking about some kind of listener which deselects the other row when a row is selected. This is my initial setup: Step 1 Search for a way to bind a method to the selection of a row (there is not something like tableview.setOnRowSelected(method) ) Step 2 Create the method which acts like a kind of listener: when a row is selected, deselect the other row (I know

JavaFX 8, ListView with Checkboxes scrollpane issue

六月ゝ 毕业季﹏ 提交于 2019-12-02 18:31:39
问题 I am using cell factory for listview with checkboxes like: listView.setCellFactory(CheckBoxListCell.forListView(new Callback < Bean, ObservableValue < Boolean >> () { @Override public ObservableValue < Boolean > call(Bean item) { BooleanProperty observable = new SimpleBooleanProperty(); observable.addListener((obs, wasSelected, isNowSelected) -> { if (isNowSelected) { if (!beanChoices.contains(item.toString())) { beanChoices.add(item.toString()); observable.setValue(true); //listView.scrollTo

scenebuilder layer classnotfound

故事扮演 提交于 2019-12-02 18:27:50
问题 I'm having problem. I used SceneBuilder and JavaFX. When I used layer in SceneBuilder and I tried to load it in java. I've got the error message below: javafx.fxml.LoadException: /C:/Projects/des_project2/target/classes/view/user/UserMainView.fxml at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2848) at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2692) at javafx.fxml.FXMLLoader.processProcessingInstruction

Change direction of javafx RotateTransition to direction of clockwise

时间秒杀一切 提交于 2019-12-02 18:17:18
问题 in my javafx application, i have an imageView for which I have created an Rotate trasition, everything works fine , but the rotation direction is in counterclockwise of watch, i want to make it in opposite direction . this is My code : RotateTransition rt = new RotateTransition(Duration.millis(3000), myImageView); rt.setByAngle(360); rt.setCycleCount(1); rt.setAutoReverse(false); rt.play() ; 回答1: It seems to be undocumented, but setting a negative angle results in a counter-clockwise rotation

JavaFX MenuItem without autohide [closed]

安稳与你 提交于 2019-12-02 16:04:18
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I want a MenuItem (more specific a CheckMenuItem) which does not auto hide on click. I know that CustomMenuItem has this functionality, but it should be a CheckMenuItem. 回答1: Use a CustomMenuItem, setHideOnClick and a CheckBox in the constructor. Edit: I just noticed that it's