javafx-8

How to remove legends in javafx line chart

我与影子孤独终老i 提交于 2019-12-02 02:07:39
I am trying to plot javafx bar graph using line chart. Each bar line is drawn using a vertical line drawn with two points and line symbol removed. There could be many series(Bar line) in my application but want to show only two legends only. Currently legends were shown as many series been added. Somehow i am able to show only two legends and hided others. But now problem exist with spaces used by hided legends. My current code is as below:- package graph; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx

JavaFX css border-radius issue

ぐ巨炮叔叔 提交于 2019-12-02 01:38:20
I am trying to simulate the effect one would get from this css example: border-radius: 50%; From searching the API and reading posts on forums including this one, I found that I should be using -fx-background-radius . This however is not giving me the wanted effect. I setup a picture as the background using -fx-background-image:url(...) and then I want to make it into a circle. How can I achieve this? Update So I see that I was not being too specific so let me try to elaborate: I created a Pane object, that does extend the Region class from JavaFX. main.fxml: ... <Pane styleClass="wrapper">

Javafx Quadrilateral Mesh

走远了吗. 提交于 2019-12-02 01:37:10
I need to display a quadrilateral mesh in javafx each mesh face having 4 points i have tried some triangle mesh examples from fxyz library , but not sure how does it work for quadrilaterals, Can someone help pointing to examples in javafx for quadrilateral mesh. The 3DViewer project that is available at the OpenJFX repository , contains already a PolygonalMesh implementation , that allows any number of points per face, so any polygon can be a face. You can use them that mesh implementation in a PolygonMeshView , instead of the regular MeshView . Since a triangle is a valid polygon, any

How can I get the indexes of each button clicked for my program?

戏子无情 提交于 2019-12-02 01:17:56
问题 So I have a double array of buttons. Once I clicked a button I need to be able to get the index of it to use for further coding(This is a minesweeper like game). This is my code so far. I have a double for loop to create a Handle event for each button but i can't figure out how to get the indexes of each button. I've tried e.getSource() but it only returns the address which would be useless. I've tried give each button a Id but it only accepts strings. I'm lost on what to do next. import

Javafx slider value at mousemoved event

為{幸葍}努か 提交于 2019-12-02 01:16:44
问题 I am making a media player and am trying to get the playback slider value at the cursor position when hovering over the slider bar. In an attempt to do this, i have used the following: timeSlider.addEventFilter(MouseEvent.MOUSE_MOVED, event -> System.out.println("hovering")); which prints "hovering" whenever the mouse changes position over the slider. Can anyone please show me how to get the value of the slider at the current cursor position? I can only figure out how to get the value at the

Javafx exception when clicking TreeTableCell after repopulating TreeTableView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 01:00:13
问题 I am currently getting an error that I do not understand. The exception that is thrown points to nothing in my code, yet it is only thrown after I repopulate a TreeTableView by clearing the root item's children and adding a new set och children to it. This is the exception: Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel.handleSelectedCellsListChangeEvent(TreeTableView.java:3056) at

Iterate TreeView nodes

与世无争的帅哥 提交于 2019-12-02 00:19:12
I'm using this code to iterate all TreeView nodes. for (TreeItem<DynamicTreeNodeModel> children1 : children) { ObservableList<TreeItem<DynamicTreeNodeModel>> children2 = children1.getChildren(); for (TreeItem<DynamicTreeNodeModel> children3 : children2) { ObservableList<TreeItem<DynamicTreeNodeModel>> children4 = children3.getChildren(); TreeItem<DynamicTreeNodeModel> tempValue = null; for (TreeItem<DynamicTreeNodeModel> children5 : children4) { // some logic } } } Is there any better way to access low level nodes of the TreeView? You can just use a recursive method, which checks if the

Put a image in a circle view

久未见 提交于 2019-12-02 00:05:18
问题 How to load any image and put it in a circle view and user with his mouse can drag the image in its circle view to his desired orientation. What control is there to do this. I tried and used a Circle filled with the imge but I cant move the image inside it nor i can select a view port in it. Any idea? 回答1: Use setClip(...) to choose a "viewport". You need to implement the dragging yourself. Something like this: import javafx.application.Application; import javafx.beans.property.ObjectProperty

Select row in Javafx Tableview

╄→尐↘猪︶ㄣ 提交于 2019-12-01 23:49:50
问题 According to my above Table view once I click on any Action icon it will navigate to another window (with selected data). How I keep selected same row when it back again to this Table view. Thanks. 回答1: So sorry actually I have duplicated the question Correct answer was there: Platform.runLater(new Runnable() { @Override public void run() { table.requestFocus(); table.getSelectionModel().select(0); table.getFocusModel().focus(0); } }); 回答2: Just remember the current selection (as a field) in

How do I start one thread for my code and one for a JavaFX Application?

烈酒焚心 提交于 2019-12-01 23:17:59
I'm trying to run a program using JavaFX. If I was using Swing, I would have one class started by the main method, and have it build the GUI class. That would give me 2 threads, normal thread for an application, and the EventQueue. That would prevent blocking the UI work. So, I tried to have the class created in the static main method construct the Application class, and then launch it. I got a RuntimeException because the program calling the launch method was not a subclass of Application. Is there a way to have separation of threads, or does everything have to work inside a the thread given