javafx

Drawing a Region with CSS -fx-shape. How it is possible?

久未见 提交于 2020-01-14 10:37:29
问题 I'm looking a way to draw shapes in a Region (JavaFX8) I've seen some examples that set the region style like this: -fx-shape : "M 3.0313 0 L 0 74 L 7.9688 74 L 4.9375 0 L 3.0313 0 Z"; Can anyone give an explanation of the meaning of this string? Is there any way to create this type of string using Visual Software? 回答1: The shape string is an SVG Path. Note the shape string for a region is the shape of the region, not a shape in a region. If you want to create shapes based on paths to put in

How to add Anchor Pane constrains in javafx code?

独自空忆成欢 提交于 2020-01-14 08:15:52
问题 I know that you can add Anchor Pane contains in fxml like:'AnchorPane.bottomAnchor="0.0"' but can you set AnchorPane constrains in java code? 回答1: There are a set of static methods on AnchorPane which you call with the node and the constraint. AnchorPane.setTopAnchor(Node, double) AnchorPane.setBottomAnchor(Node, double) ... etc. Example AnchorPane.setBottomAnchor(button, 0.0); 来源: https://stackoverflow.com/questions/28245538/how-to-add-anchor-pane-constrains-in-javafx-code

How to add Anchor Pane constrains in javafx code?

孤街醉人 提交于 2020-01-14 08:15:40
问题 I know that you can add Anchor Pane contains in fxml like:'AnchorPane.bottomAnchor="0.0"' but can you set AnchorPane constrains in java code? 回答1: There are a set of static methods on AnchorPane which you call with the node and the constraint. AnchorPane.setTopAnchor(Node, double) AnchorPane.setBottomAnchor(Node, double) ... etc. Example AnchorPane.setBottomAnchor(button, 0.0); 来源: https://stackoverflow.com/questions/28245538/how-to-add-anchor-pane-constrains-in-javafx-code

JavaFX ImageView not updating

痞子三分冷 提交于 2020-01-14 07:01:27
问题 So I'm trying to load and save Images into an imageView where the location of the image is chosen through a file browser. I've been working on this for several days now and I'm gonna have a stroke if I can't get it fixed. I've tried everything I can think of. Thank you in advance for helping. UPDATED : Here is my main class: public class Main extends Application { private Stage primaryStage; private BorderPane rootLayout; public Main(){} @Override public void start(Stage primaryStage) throws

JavaFX ImageView not updating

安稳与你 提交于 2020-01-14 07:01:25
问题 So I'm trying to load and save Images into an imageView where the location of the image is chosen through a file browser. I've been working on this for several days now and I'm gonna have a stroke if I can't get it fixed. I've tried everything I can think of. Thank you in advance for helping. UPDATED : Here is my main class: public class Main extends Application { private Stage primaryStage; private BorderPane rootLayout; public Main(){} @Override public void start(Stage primaryStage) throws

Sort Javafx table on multiple columns

断了今生、忘了曾经 提交于 2020-01-14 06:29:10
问题 Can a default Javafx table sort on multiple fields by dragging the columns on a dropzone? My user need to select one or multiple columns to sort on different columns. The application is fully written in Java8 with JavaFX. The source code that I now use is: import java.util.Collections; import java.util.Comparator; import java.util.function.Function; import javafx.application.Application; import javafx.beans.property.SimpleObjectProperty; import javafx.geometry.Insets; import javafx.geometry

javafx WebView setMember() before script

柔情痞子 提交于 2020-01-14 05:14:12
问题 I am trying to set some javascript items on my page, but the items are getting set after the javascript runs on the page. So for example, I created a Console.log() method to display stuff in my java console for debugging purposes. But the items are getting set after the page code runs so the logging doesn't work (See second block of code). Is there a way for me to initiate the code before the javascript on the page runs? So, here is how I am initiating the item in my Java application:

JavaFX TableView: open detail information between rows on click

╄→гoц情女王★ 提交于 2020-01-14 04:22:08
问题 I'm trying to display travel connections in a TableView. So far that works like a charm. Now I'm kinda stuck trying to get details of a connection to be displayed in between table rows. This should happen on selecting a table item. The problem is, that the details are in a different format than the connections I'm displaying. So I would need to put a panel between two table rows. Is this at all possible? 回答1: The "proper" way to do this would be to create a custom skin for TableRow and use a

Javafx: how do I reference a particular cell within a row in setRowFactory?

≯℡__Kan透↙ 提交于 2020-01-13 19:21:08
问题 I have a tableView, where each table row represents an object and each column represents the attributes of the object. Within the tableView, I am defining a setRowFactory . Within the setRowFactory , I want to be able to have access to a particular cell within the row and highlight it by doing this: ThisCellofThisRow.pseudoClassStateChanged(...) Problem is: I have no idea how to reference this ThisCellofThisRow . 回答1: Not sure exactly what you want to do, but you could change the pseudoclass

JavaFX Pane inside of a Tab

喜你入骨 提交于 2020-01-13 18:22:48
问题 I want to extend a Class from Pane and then use the setContent() method from a tab from TabPane to display the Pane inside this Tab. It worked in Swing when I extended from JPanel but if I try something similar in JavaFX it only displays the tab itself and stays empty below. I want to handle the content of the tabs in separate classes, am I doing something completely wrong here? Swing version: import java.awt.*; import javax.swing.*; import java.util.*; public class Home extends JFrame{