javafx

NullPointer Exception on setText() while everything is properly loaded and annotated

我的梦境 提交于 2020-01-11 09:52:13
问题 I'm receiving the following exception trying to call setText() on my annotated label, from the start() method. I've seen a similar question, but the reason why it didn't work for that person is because his label isn't annotated, while mine is. java.lang.NullPointerException at io.github.blubdalegend.openbravery.OpenBravery.applyBuild(OpenBravery.java:67) at io.github.blubdalegend.openbravery.OpenBravery.start(OpenBravery.java:58) at com.sun.javafx.application.LauncherImpl.lambda

JavaFx TableView issues with big data

蹲街弑〆低调 提交于 2020-01-11 09:34:07
问题 I have been using JavaFx's tableview to display a huge amount of data from the database. The table is like 150+ columns and millions of rows. I can handle the rows by getting the data in chunks and implementing paginations(link). But the no of columns is also an area of concern. It takes a lot of time to paint the data and does not update the data when I change the values in the model(ref). I dont have a predefined data structure and so the method at this is not useful. I moved on to use

Javafx TabPane with multiple rows of tabs

谁说胖子不能爱 提交于 2020-01-11 07:44:08
问题 I'd like to use a (JavaFX) TabPane to display the content of 20 different tabs. This works fine with the standard TabPane, however, when the pane hits a certain amount of tabs, a button / ComboBox can be clicked to click on one of the tabs not seen. I'm designing a feature that will be used on a touchscreen, so this is not ideal. I think it'd be more intuitive to have two separate rows of tabs. How can I add two rows of tabs to a TabPane, or, what can be done to achieve a similar effect?

JavaFX resize canvas in fxml

女生的网名这么多〃 提交于 2020-01-11 06:47:46
问题 I'm trying to resize a canvas in Javafx. I am using scene builder and fxml. So far, when the user clicks on the canvas the canvas turns black, and when I resize the screen and click on the canvas only the original size of the canvas turns black (canvas is not being resized). I'm not sure how to solve this. Any ideas or solutions would help alot. Code: Controller: public class MainFXMLController implements Initializable { @FXML private Canvas mainCanvas; @FXML public GraphicsContext gc; public

How to draw or plot a mesh using the mouse in JavaFX which can then be textured and deformed?

China☆狼群 提交于 2020-01-11 06:16:08
问题 I am trying to implement a tool into my application. the tool would allow the user to plot a triangle meshes using the mouse. I have looked everywhere for a way to do this, tutorials, examples, etc and have not been successful. I have seen the FXyz library but that does not really simulate What I am trying to accomplish. The goal of the program looks as follows: Use Case Sequence: The user adds a png image to the 3D scene or drags it into the 3D scene using the mouse. Once the image is being

Using fx:id as CSS id in FXML

拈花ヽ惹草 提交于 2020-01-11 04:59:25
问题 It seems that in FXML if you don't specify a ID (CSS) then the fx:id value is used by default. My previous understanding was the two were completely disjoint, ID for CSS and only CSS. fx:id for @FXML bindings in the controller. This can be demonstrated with a small test - three buttons, first with ID, second with FX:ID, third with both types of ID. <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http:/

Is it possible to make JavaFX web applet?

≯℡__Kan透↙ 提交于 2020-01-11 04:47:12
问题 I like old Java applets. But because I really like the way JFX works, I want write some games using it (or even game making system, who knows?), but I'd like to be able to post them on my website. How would one go about doing this? 回答1: Yes, you should be able to embed JavaFX in your web page: http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_toolkit.html#BABJHEJA http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 回答2: Yes, you can embed a JavaFX GUI into the

When to use StringProperty over String?

谁说我不能喝 提交于 2020-01-11 04:22:05
问题 I am developing an application in JavaFX where I want to represent information of a Person in a single Person class. I came across a tutorial where a Person's name was being represented as a StringProperty instead of String . I have searched for the differences of these and found out this and this but the explanation there is not sufficient for me to grab the concept. Some post on the net said there are advantages of using StringProperty over String but could not mention them. Now my question

java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox@872be7

断了今生、忘了曾经 提交于 2020-01-11 02:27:27
问题 Am trying to read some values from MySQL database and display it in a Menu in JavaFX. My code is below. Previously I used Buttons instead of Menu. It worked fine, but I don't felt better with Buttons, so I decided to use Menu. I got the exception mentioned in the heading when I Ran this code. private VBox userSelection() throws ClassNotFoundException, SQLException { VBox vb1 = new VBox(); vb1.setPadding(new Insets(40, 150, 20, 200)); vb1.setSpacing(20); MenuBar menuBar = new MenuBar(); Menu

Tree item select event in javafx2

允我心安 提交于 2020-01-10 17:31:12
问题 I have created the treeview in javafx2. i need to write the event for getting clicked node name. pls let me know how to do this? 回答1: use ChangeListener . Sample code : treeView.getSelectionModel().selectedItemProperty().addListener( new ChangeListener() { @Override public void changed(ObservableValue observable, Object oldValue, Object newValue) { TreeItem<String> selectedItem = (TreeItem<String>) newValue; System.out.println("Selected Text : " + selectedItem.getValue()); // do what ever you