javafx-8

How to style a SVG using CSS in javaFX FXML

廉价感情. 提交于 2019-12-04 08:50:24
I'm using SVG for an image in a button. But I'm not able to fill in color for it through CSS. Below is the code to render a button. <Button onAction="#closeApplication" > <graphic> <SVGPath content="M10,16 10,0 0,8z" styleClass="button‐icon‐shape" /> </graphic> </Button> here is the css .button-icon-shape SVGPath{ -fx-fill: red; } here is how it worked. I had to style the button and use the class to style the svg in the button. <Button onAction="#closeApplication" styleClass="closeButton"> <graphic> <SVGPath content="M10,16 10,0 0,8z" /> </graphic> </Button> here is the css .closeButton{ }

How to get a small ProgressBar in JavaFX

删除回忆录丶 提交于 2019-12-04 07:32:41
I'm trying to get an iTunes like progress bar that is very small (height of about 5px) but I can't seem to go any lower than 19 or 20px. I tried setting -fx-max-height with no avail, also on the surrounding pane. Note that this value does indeed change the height - I just can't get it less than about 20px. Any ideas how to achieve that? I'd like to avoid using a plain rectangle for indicating progress because of loss of semantic and support of assistive technology. Thanks. The ProgressBar default styling is the reason why you can't reduce its height. As we can see in the modena.css file for

Allow user to copy data from TableView

随声附和 提交于 2019-12-04 06:29:57
I have a simple JavaFX app that allows the user to query a database and see the data in a table. I'd like to allow the user to be able to click a table cell and copy text from that cell to the clipboard with the standard clipboard key stroke: ctrl-c for Win/Linux or cmd-c for Mac. FYI, the text entry controls support basic copy/paste by default. I'm using the standard javafx.scene.control.TableView class. Is there a simple way to enable cell copy? I did some searches and I see other people create custom menu commands... I don't want to create a custom menu, I just want basic keyboard copy to

How to draw a line from the point to X axis, in the JavaFX ScatterChart?

偶尔善良 提交于 2019-12-04 06:25:31
问题 Now I am work with JavaFX ScatterChart and I need to draw a line from the point of data to X axis, as I show in the image below. Thak you for your help!! 回答1: You'll have to create a custom chart and add the lines as custom nodes. This is very similar to the marker lines in the answer to the Adding a line in a JavaFX chart question. 来源: https://stackoverflow.com/questions/29463467/how-to-draw-a-line-from-the-point-to-x-axis-in-the-javafx-scatterchart

JavaFX TableView custom cell rendering split menu button

给你一囗甜甜゛ 提交于 2019-12-04 06:23:41
问题 i've a problem with a custom cell render in a java fx table view component. I'm able to render the split menu button, but is only rendered from second row of table. Below i put the code created to generate that image. SplitMenuButtonApp.java package com.example.splimenubtn; import java.util.ArrayList; import java.util.List; import javafx.application.Application; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.collections

JavaFX and SwingNode - partial black Window

落爺英雄遲暮 提交于 2019-12-04 06:00:55
问题 I tried to use Swing Components in JavaFX with the SwingNode: public class MyTest extends Application { @Override public void start(Stage stage) { final SwingNode swingNode = new SwingNode(); FlowPane pane = new FlowPane(); Button btn = new Button("1"); btn.setVisible(false); pane.getChildren().add(btn); createAndSetSwingContent(swingNode); pane.getChildren().add(swingNode); stage.setScene(new Scene(pane, 100, 50)); stage.show(); btn.setVisible(true); } private void createAndSetSwingContent

JavaFX: Radio Button + CheckBox TreeView

时光总嘲笑我的痴心妄想 提交于 2019-12-04 05:51:04
问题 in reference to my earlier question here, I did the code below. I am trying to make a treeview which shows a radio button for leafs, and checkboxes for non-leaf items. The code below does not show anything. I am sure I am doing something extremely wrong somewhere (or everywhere). Any help is much appreciated. Thanks public class RadioCheckBoxTreeView extends TreeView { public RadioCheckBoxTreeView() { setCellFactory(new Callback<TreeView<Object>, TreeCell<Object>>() { @Override public

JavaFX SortedList: listen the list changes and the list items updated event

≯℡__Kan透↙ 提交于 2019-12-04 05:26:27
问题 Use case : an ordered ListView (or TableView) insertions are made after display updates of the keys are made after display List at startup: After adding 18: After update: As you can see nothing change! The code: public final class SortedListTest extends Application { @Override public void start( Stage stage ) throws Exception { final ObservableList<IntegerProperty> il = FXCollections.observableArrayList(); il.add( new SimpleIntegerProperty( 12 )); il.add( new SimpleIntegerProperty( 24 )); il

JavaFX application fail to launch with native exe bundle

丶灬走出姿态 提交于 2019-12-04 05:23:38
问题 I have build a JavaFX application which can be executed by its jar file. However if i try to run it using the native exe bundle i am receiving two popups: com/npap/dicomrouter/Main - no main class failed to launch JVM and the application fails to start. This is my Main class (most of its part): package com.npap.dicomrouter; public class Main extends Application { ... public static void main(String[] args) throws IOException { try { JUnique.acquireLock(appId); alreadyRunning = false; log.info(

Image from clipboard not correctly displayed in JavaFX 8 application

ⅰ亾dé卋堺 提交于 2019-12-04 04:39:14
问题 This program shall paste an image from clipboard into an ImageView (on Windows 10). Unfortunately the image is not correctly displayed. public class PasteImageFromClipboard extends Application { ImageView imageView = new ImageView(); Button bnPaste = new Button("Paste"); public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) throws Exception { bnPaste.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) {