javafx

How to set a TableRow's background colour based on whether or not it's selected and/or a value in the data model, in a JavaFX8 TableView?

强颜欢笑 提交于 2020-01-15 12:15:21
问题 A relative Java newbie question. I'm trying set a TableRow 's background colour based on whether or not it's selected and/or whether or not a boolean value in the data model is true. I've found ways of doing each but not both together in the same setRowFactory . What I would like to end up with is this (albeit with horrible colours for example purposes only!): How would I go about achieving that? This is what I found wrt changing row colour based on selection. It's adapted from user James_D's

How to set a TableRow's background colour based on whether or not it's selected and/or a value in the data model, in a JavaFX8 TableView?

ぐ巨炮叔叔 提交于 2020-01-15 12:15:20
问题 A relative Java newbie question. I'm trying set a TableRow 's background colour based on whether or not it's selected and/or whether or not a boolean value in the data model is true. I've found ways of doing each but not both together in the same setRowFactory . What I would like to end up with is this (albeit with horrible colours for example purposes only!): How would I go about achieving that? This is what I found wrt changing row colour based on selection. It's adapted from user James_D's

How to center a ImageView node within Region in JavaFx?

杀马特。学长 韩版系。学妹 提交于 2020-01-15 10:53:29
问题 I'm having trouble with centering an ImageView node within the following Browser object. I have provided a snippet of the code below. My thought was to use setStyle("....."), but that didn't appear to have any influence on the placement of the image (It is still displayed top left corner). Any suggestions are greatly appreciated. Thanks! class Browser extends Region { final WebView browser = new WebView(); final WebEngine webEngine = browser.getEngine(); File file; ImageView image; public

Use progressbar made with fxml (scenebuilder) to use values from a method [duplicate]

混江龙づ霸主 提交于 2020-01-15 10:37:06
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 3 years ago . I want my progressbar to display the values of a method thats returns double values but it doesnt work. But I dont think thats the main problem bc even when I just use a specific number it doesnt work either. Please help me, thanks in advance. That's specific question so I searched cery long without results so if you know a better to do what I want to do or maybe

JavaFX and printing to Epson printer

自闭症网瘾萝莉.ら 提交于 2020-01-15 10:03:44
问题 I need to know the answer of those questions, concerning Epson printers : Can I use Javafx print API to print to an EPSON printer ? or should I use the JavaPOS API ? How do I print Images to that printer ? How to setup page size ? I have Epson TM-20II printer. 回答1: Use JasperViewerFX, which is full featured JasperReport viewer written completely in JavaFx . 回答2: After some research and experience with an epson printer (the model in the question) Can I use Javafx print API to print to an EPSON

How to serialize JavaFX Nodes preferably in XML?

扶醉桌前 提交于 2020-01-15 09:47:11
问题 I have some kind of drawpane, where the user can draw different kinds of Shapes, like Pathes, Rectangles, Texts, etc. Now I´d like to persist the DrawState, so that I can recreate it at any time. I just tried it with xstream, but like usual I get a whole lot of dependencies within these Shapes when persisting it in XML. After some research I found this Thread here: Serialize JavaFX components I liked the idea of jewelsea using the SceneBuilder API to serialize my shapes, since they are all

Default Table Model in JavaFX

回眸只為那壹抹淺笑 提交于 2020-01-15 09:10:00
问题 I have encountered some problem when trying to select single row from table view in JavaFX. Here is how I populate my table with data from database: public void populateCategoryTable() { data = FXCollections.observableArrayList(); try { db.getConnection(); String sql = "SELECT * FROM sm_category"; ResultSet rs = null; // Call readRequest to get the result rs = db.readRequest(sql); while (rs.next()) { ObservableList<String> row = FXCollections.observableArrayList(); //All the rows are added

Default Table Model in JavaFX

情到浓时终转凉″ 提交于 2020-01-15 09:09:10
问题 I have encountered some problem when trying to select single row from table view in JavaFX. Here is how I populate my table with data from database: public void populateCategoryTable() { data = FXCollections.observableArrayList(); try { db.getConnection(); String sql = "SELECT * FROM sm_category"; ResultSet rs = null; // Call readRequest to get the result rs = db.readRequest(sql); while (rs.next()) { ObservableList<String> row = FXCollections.observableArrayList(); //All the rows are added

How to merge multiple 3D objects as a single Mesh in order to remove a visual glitch?

◇◆丶佛笑我妖孽 提交于 2020-01-15 08:55:50
问题 I've been doing a lot of voxel terrain generation with JavaFX 3D. For some reason, whenever I generate a landscape, the right side of the landscape will always have these weird black lines. I've tried changing the PerspectiveCamera 's near and far clip values, but they seem to have no effect. In case you need it, my near clip value is set to 0.1 and my far clip value is set to 100000.0 . Here is a picture of my program, as you can see, there are clear visual glitches present mainly on the

Java FX 2 on IBM jdk?

大城市里の小女人 提交于 2020-01-15 08:53:12
问题 Does IBM's java 7 bundle Java FX 2? I have JDK Version 7 Release 1 for Linux (32 bit) and it doesn't seem to contain it. If it doesn't, can I still use it, and what do I need to do for that? Thanks 回答1: No, IBM Java 7 does not include JavaFX 2. The Oracle distributions of Java 7 and 8 are the only supported Java runtimes that include JavaFX that I am aware of at this time. JavaFX 2 is mostly closed source, so you can't really port it to any other runtimes. JavaFX 8 is completely open source,