FAQ Database Discussion Community


Where do I file bugs for JavaFX?

javafx,javafx-8,scenebuilder
Now that JavaFX Jira Issue Tracker has been moved to JDK Bug System, I don't find an option to file a new bug to the developers. Rather, I find an information saying: Everyone with OpenJDK Author status or above has a JBS account which may be used to create and...

Convert DoubleBinding value to IntegerBinding

binding,javafx,double,javafx-8
I have the following Problem. I want to concat a String with an DoubleBinding to an String property. Slider slider = new Slider(1, 5000, 500); Label sliderValue = new Label(); sliderValue.textProperty().bind(Bindings.concat("Sleep: ", slider.valueProperty())); This is working fine. But I don't want to display the Double Binding as an Double, I...

UI4J - Get the entire document innerhtml

java,javafx,ui4j
Is there a way to get the innerhtml for the entire page, including html, head, body and so on. I am only able to call page.getDocument().getBody().getInnerHTML() ... there is no page.getDocument().getInnerHTML() ... shouldn't there be ?...

java - Is JavaFX SortedList stable?

sorting,javafx
Let's say I want to sort a list twice, using different comparators each, with the first comparator taking precedence over the second. Is it OK to simply call the SortedList constructor twice, with one call for each comparator? To clarify why I want to do this, let's say I have...

LayoutY of GridPane not affected by ScrollBar Listener

java,javafx
I have a GridPane that i fill dynamically, then I display it, the problem is: if the rows are so many, then the rows in the bottom don't get displayed, what i want is to add a scrollbar so that I can display all of the rows, here is the...

JavaFX - How do you open and display an image in a pane?

java,image,model-view-controller,javafx
I am trying to create an application that will allow users to open an image file and display it in a pane. I have chosen JavaFX to create the GUI but this has presented some difficultly with the code below: public class Controller implements Initializable { ... public void openFile()...

Javafx - How to Add Pie Chart to BorderPane from Different Class

java,charts,javafx
I have two classes. A Main class and a Chart class. My Chart class extends PieChart and instantiates a Pie Chart in its constructor. My main class creates a BorderPane, I then instantiate an object of the Chart class(creating the Pie Chart) and add it to the center pane.The only...

How can I access a control that's in a grid pane?

java,loops,javafx,fxml,gridpane
I have defined a grid pane in a java fxml file as follows: <GridPane fx:id="grid" gridLinesVisible="true" prefHeight="256" prefWidth="256"> ... <children> <Label maxHeight="1.8" maxWidth="1.8" /> <Label maxHeight="1.8" maxWidth="1.8" GridPane.columnIndex="1" /> <Label maxHeight="1.8" maxWidth="1.8" GridPane.columnIndex="2" /> <Label maxHeight="1.8" maxWidth="1.8" GridPane.rowIndex="1" /> <Label maxHeight="1.8" maxWidth="1.8" GridPane.columnIndex="1" GridPane.rowIndex="1" /> <Label maxHeight="1.8"...

How is the Point2D “angle” method to be understood?

javafx,geometry
I thought I'd use the Point2D class for calculating e. g. the angle betwen 2 points instead of creating a utility method. It turned out, it's not usable at all. Code example: Point2D p1; Point2D p2; p1 = new Point2D(0, 0); p2 = new Point2D(10, 10); System.out.println( "Point2D: " +...

Chart JavaFX, my hover Label are hidden by the edges of chart

charts,javafx,popup,linechart
I have a problem again with the JavaFX Chart : D Context : I had Popup/Label on my chart to display the value on hover : JavaFX LineChart Hover Values (Jewelsea answer) Problem : But when the point are near the edges of chart, the popup is hidden by them....

How to display HTML in JavaFX Application

java,javafx,javafx-8
I am developing a FontViewer application which changes the font of the text based on the selected font style. This is the controller class of my application public class FXMLDocumentController implements Initializable { @FXML private ListView fontListView; @FXML private TextArea fontTextArea; int[] fontSizes = {34, 28, 24, 20, 18, 16,...

FXML: ClassNotFoundException

javafx,fxml,fxmlloader
I'm very new to JavaFX and I'm having problem using my custom class in FXML. The console keeps giving me this exception when trying to load main.fxml: ... 1 more Caused by: java.lang.ClassNotFoundException: sample.View$BoardPane at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ... I created BoardPane class as a subclass of FlowPane in package sample.View and...

JavaFx: Button border and hover

java,css,javafx,java-8
I am using Java 8. I have toolbar and buttons on it. I want to implement the following: In usual state (without mouse hover) at toolbar, only button label must be seen (no background, nor borders). When the user mouse hovers over the button, then the usual button must be...

How to pass JavaFX variable into CSS style?

javafx,javafx-8,javafx-css
I want to take selected color and change background color of button. private void handleItemBackAction(ActionEvent eve) { System.out.println("You clicked Set Background Color of Item!"); java.awt.Color color=JColorChooser.showDialog(null,"Select a color",java.awt.Color.CYAN); String hex = Integer.toHexString(color.getRGB() & 0xffffff); hex="#"+hex; Text.setText(hex); ShortcutButton.setStyle("-fx-background-color: hex;"); } ...

JavaFX - How to add Item to ListView from different Stage?

java,listview,javafx
How can i add an item to an already existing ListView from a different Stage (Window). Basically i just want to add Text to the ListView from Window 2 to the ListView in Window 1. Thanks in advance. Sorry i forgot this is what i've got so far in my...

JavaFX FilteredList, filtering based on property of items in the list

javafx,javafx-8
I have a case where I need to filter a ObservableList<Item> based on some properties of the items (i.e. the condition is internal and not external). I found out that javafx has FilteredList so I tried it. I could set the predicate and filtering works, until the property value that...

Nested PathTransitions in JavaFX

java,javafx,path-traversal
I am trying to get my node to travel along the path of a circle, and at the same time have THAT circle travel along the path of a rectangle. Is it possible? This is what I have so far: void move(GamePane aThis) { double speed = 10; Rectangle rectangle...

Can I apply 2D transforms to shapes on a JavaFX 8 Canvas?

java,javafx,javafx-8
I'm porting a class that that was previously done in Swing to JavaFX 8. It displays a UI element that looks like an analog electric voltage meter with a half circle surrounded by a collection of "tic marks" at regular intervals. In the Swing version the class was an extension...

How to analyze incoming message (JavaFX on Android)

java,javafx,javafx-2,javafx-8,javafxports
I ported my JavaFX application to my Android device. I want my application to read incoming SMS messages and store it in a database. I found several questions here in StackOverflow but I don't know how to implement in a JavaFX approach. Please help!

javaFX : How to periodically load information from db and show it on a Label?

database,timer,javafx
I want to execute a method periodically, this method get informations from database it show it into a label, I tried the following code : Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { //update information miseAjour(); } }, 0, 2000); when i run the main...

JavaFX - TableView successfully populated but NPE still occurs

javafx,nullpointerexception,tableview
I am populating my TableView with data from the database. When I select a row in the TableView(Tableview has listener) and then re-populate again the TableView, the data population is successful but a NPE occurs. I hope I expressed myself clearly. Sorry for the long post. ActionEvent @FXML private void...

When I use hsqldb I have problems with GUI (JavaFx)

java,javafx,x11,hsqldb
I can't understand how RDB can be linked with GUI but I've checked several times. I have osgi javafx application. when I install hsqldb and use database I have strange problems: Before that I used h2 and I didn't have anything like that. And the only thing was changed is...

JavaFx: liquid and fixed gridpane column widths

java,javafx
I have gridpane with 4 columns (fixed1,liquid,fixed2,liquid). The every liquid column must have the width= (gridpane width-fixed1-fixed2)/2. By other words 50% of liquid width. Important: all width=liquid width+fixed width. In order to set column constraint I've found the following code: GridPane gridpane = new GridPane(); ColumnConstraints col1 = new ColumnConstraints();...

JavaFX: How to resize button containing svg image

java,svg,javafx,resize
I want to place a svg image inside a button, and then I want to be able to resize the button to any size. First, this is how I've done the loading and placing of the svg image inside the button: SVGPath svg = new SVGPath(); svg.setContent("M87.5,50.002C87.5,29.293,70.712,12.5,50,12.5c-20.712,0-37.5,16.793-37.5,37.502C12.5,70.712,29.288,87.5,50,87.5 c6.668,0,12.918-1.756,18.342-4.809c0.61-0.22,1.049-0.799,1.049-1.486c0-0.622-0.361-1.153-0.882-1.413l0.003-0.004l-6.529-4.002...

Are JavaFX Property objects threadsafe for multiple asynchronous writes?

java,multithreading,concurrency,javafx,javafx-8
Is it dangerous for the standard implementations of Property in JavaFX to call set methods from multiple threads? I don't really care about race conditions on the client side from reading-and-then-setting operations. I want to know if the Property itself can be corrupted internally if multiple threads call its set()...

What is wrong with this JavaFX/FXML custom component?

java,javafx,javafx-8,fxml,fxmlloader
I am learning to write FXML custom components for use with JavaFX 8 and Scene Builder. I wrote the FXML file shown below but Scene Builder will not open it, giving me the message "Open operation has failed" due to the exception: java.io.IOException: javafx.fxml.LoadException: mycustomcomponent.TicoTeco is not a valid type....

JavaFX subclassed Button - How to make Label update work?

java,javafx
I want to have several JavaFX Buttons that update one Label in my Application with text. For testing purposes it's just Button Text. What I did at first worked fine and looked like this: String Text = "..."; public void kons() { System.out.println("Works..."); System.out.println(Text); Tekst.setText(Text); Button G4 = new Button("Spadantes");...

How can I use True Type Collection (.ttc) in JavaFX?

css,javafx,truetype,richtextfx
I've successfully loaded .ttf fonts in CSS in my application. When I try to load .ttc for international language support, I get this Jun 08, 2015 10:12:44 AM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged INFO: Could not load @font-face font [file:/E:/DanIDE/out/production/DanIDE/font/tsentsiu-sans-mono-regular.ttc] So my question is how do I use .ttc in my JavaFX project?...

JavaFx TreeCell how to expand nodes after one second

javafx,nodes,expand,treecell
i'm implementing the Drag&Drop on a generic TreeView. My purpose is to expand a folder during DragEntered event after a second of stationing, actual code: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ enteredItem.setGraphic(images.getFolderOpened()); enteredItem.setExpanded(true); } e.consume(); }); desired: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ if(dragDuration >= 1...

JavaFx: combobox max width

java,javafx
I want to do: fixed column, liquid column(50%), fixed column, liquid column(50%) in GridPane. And I have the following FXML: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.60-ea" xmlns:fx="http://javafx.com/fxml/1"> <children> <GridPane...

How to draw a rectangle over an element on the image using JavaFX?

javafx
I have an image which is displayed on my JavaFX application. Given the coordinates, I must display that part on the image using a rectangle. For example, if there is a textfield on the image and I give the coordinates of the textfield, a rectangle should appear over the textfield...

Opening frame that is under the JavaFX program category

eclipse,video,javafx,jframe,mp4
Most of program is using JFrames throughout the application for all the different windows that can appear. However, I have to play an instructional video for the user inside a JFrame. I couldn't find a way to do this, so I had to make a JavaFX program. Is there a...

Comparing 2 dates javafx

java,hibernate,date,javafx,javafx-2
I'm writing an application which is based on javafx/hibernate. Now i have problem when i want to make new table with articles that are sold last 7/30/365 days (or custom date chosen). articles are stored in database with current date (Date articleDate = new Date(); ) all articles are fetched...

Javafx add text to a progress bar inside a table

javafx,progress
I've been working with javafx tables and managed to add a Table Column with progress bars using progressBarColumn.setCellFactory(ProgressBarTableCell.forTableColumn());, it uses a dummy Person class to get its data not javafx.concurrent.Task. All works well but i was wondering if you could also add text to the progress bars in the table,...

How to fill a JavaFX Sphere with two Colors

java,css,javafx,javafx-3d
How can I fill in JavaFX a 3D Sphere with a linear gradient like a 2d Circle? I work with the JavaFX Scene Builder. ...

JavaFx - increase space between text and tab header area edge

java,javafx
I can't understand what element I should work to do this task. I tried .tab-header-area .tab{ -fx-background-color:red; -fx-padding:30px; } EDIT 1 This is what I get But I have the same tab header inside big red rectangle. How can I increase distance between text and edge of the tab header...

JavaFx TreeView css

javafx,treeview
I am would like to create element looking and behaving as the one shown below. There is dark background and top list of 4 elements: "biblioteki", "Analiza" and so on. hen we click on one of them list is expanded and this item and its children gets light dark backgorund....

Filter JDK Bug System by JavaFX

java,javafx,openjdk
Is there a way (filter settings, etc) to see only JavaFX related bugs in the JDK Bug System? Also, the Reporter names seem to be gone. Now I'm "J. Duke", I guess like everyone else that doesn't have an acount there. So how do I find the bugs I reported?...

Simultaneous Rotate and Translate not working as expected in javafx

graphics,javafx,javafx-8,drag
I have built the following "system" from Circles and a Line. I am trying to implement just following two transitions in the system. When the Green Circle is dragged, both the Green and Blue circle should rotate about the Red center, in the direction of drag. When the Red center...

JavaFX PiChart, my hover values blink

javafx,popup,label
Context : Hi ! I'm trying to create a little popup which display the value of slice when mouse hover, on my PieChart (with JavaFX). I successed on my LineChart, AreaChart etc.. Thanks this post : JavaFX LineChart Hover Values (thank you so much Jewelsea for your help). Problem (1/2)...

JavaFX splash screen message and progress not updating

java,multithreading,javafx
I have a JavaFX application that checks for the presence of a database at startup. If the database is not found, a "seed" database must be created before the program can proceed. Since creating the seed database can be lengthy, I want to display a splash screen and show progress...

Build macro result with loops

clojure,javafx
I'm building a macro that should be called like this: (myMacro MyController something otherthing (defn onFoo [this event] (println "ok")) (defn onBar [this event] (println "ok")) ) After the first three parameters I want to be able to pass a few functions that should be used to build the function...

FXML file won't load even when file path is correct

java,eclipse,javafx
I am trying to load an FXML file: URL url = getClass().getClassLoader().getResource("/frontEnd/fxml/ModeScreen.fxml"); try { this.value = FXMLLoader.load(url); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } But when I run, I get: NullPointerException: Location is required the path to my fxml file is: src/frontEnd/fxml/ModeScreen.fxml and the path...

JavaFX TextField : Automatically transform text to uppercase

java,javafx,fxml,keyevent
I have a JavaFX TextField control on my FXMl that looks like this... <TextField fx:id="input_search" onKeyPressed="#keyListener" prefHeight="25.0" prefWidth="197.0" /> I want to automatically change all characters to uppercase when the user is typing. The code in my controller : public void keyListener(KeyEvent event){ //maybe transform the pressed key to uppercase...

JavaFX Input Validation Textfield

java,javafx
I'm using JavaFX and Scene Builder and I have a form with textfields. Three of these textfields are parsed from strings to doubles. I want them to be school marks so they should only be allowed to be between 1.0 and 6.0. The user should not be allowed to write...

Javafx Tableview dont show data of ObservableList

user-interface,javafx
i have a Problem mit the Tableview in JavaFX. I know there are some other posts in the forum, but i checked them and tried to use the solutions, but nothing work for me ... I have 3 Classes. One Version class, the data model. The Class which populats the...

JavaFX Null Pointer Exception: Location is required

java,javafx,javafx-8
JavaFX newbie here. I am using NetBeans 8.0 IDE and I placed my FXML file RootLayout.fxml in com.techie.java.view package. I am loading this fxml file using the following code declared in com.techie.java.controller package: private void initRootLayout() { try { pane = FXMLLoader.load(ContactManager.class.getResource("/view/RootLayout.fxml")); Scene scene = new Scene(pane); stage.setScene(scene); stage.show(); }...

JavaFx: how to make HTMLEditor not to create emtire HTML document?

java,javafx
When javafx create object of HTMLEditor it has the empty html document with the following html: <html dir="ltr"><head></head><body contenteditable="true"></body></html> However, I don't need entire html document. I want to work only with some node in html editor, for example with div. I tried to do htmlEditor.setHtmlText(null) or htmlEditor.setHtmlText("") but it...

Present node +LineChart + JavaFX

javafx,linechart
I am using LineChart in the javafx8 and I am able to get the series plotted dynamically in the graph and the symbols plotted for every input. But the problem is I just want to show the symbol for the present node and not for the nodes which are already...

Multi-Threading error when binding a StringProperty

java,multithreading,javafx,javafx-8
I have a question about multi-threading and the binding of a StringProperty. I have a class CacheManager, which contains a Thread which updates my cache with the changes on the server. Now, I want to notify the user with a text and percentage of the progress (which are a Label...

Using ReactFX to resize stage when nodes become invisible?

javafx,javafx-8,rx-java,reactfx
I have a JavaFX dashboard that hides and shows components based on complicated contexts, so ReactFX is a great utility for this. I created some nested closures by looping through each node, creating an EventStream off eachvisibleProperty(), and then subscribing an operation to switch the managedProperty() and call sizeToScene(). Although...

Can''t get JavaScript to work in WebView

javafx,javafx-8,javafx-webengine
I have a fairly simple JavaFX application. It has one window, split in two. On the left is a tableview that lists rows from a database. When you select one of the rows, it displays the XML (also from the database) in a webview on the right. So far so...

JavaFx - tab order in SceneBuilder

java,javafx
How can I set tab order (focus order) for elements, for example text field in SceneBuilder?

How to create toolbar with left, center and right sections in javaFX?

java,javafx,alignment,toolbar
I'm trying to create a customized toolbar in javafx. This toolbar should be able to display controls in the center, in the left side and in the right side (three sections) of its surface. The problem is that I have no idea to achive this. I read many hints related...

JavaFX WebView can't load certain sites

java,webview,javafx,javafx-8,javafx-webengine
I'm trying to use JavaFX's WebView to load this site, but all I get is a blank screen. The WebView is working perfectly fine on other sites; it gets 100/100 on ACID3 and loads other HTTPS sites without any problems whatsoever. I can't find anything particularly wrong with the site...

Exception when using CheckListView of Controls FX

javafx,controlfx
I have the error : Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 0 I thought it was because I have to use Platform.runLater(), but it seems the errors does not come from this. Here's the function that I try to correct with Platform.runLater() : public void setListAirportForFilter(ListAirport listAirport){ this.myListAirport...

Javafx TextField pseudoClassStateChanged method not working

java,javafx
I'm setting PseudoClass to TextField to highlight them when error occurs. The red border appears around TextField only when I click mouse inside it (to put text value), but I need to show border all time. there is how I sets border: element.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); It worked just fine till last...

How to change the color of treeitem expand and collapse arrow in javafx?

javafx,treeview
I have got some trouble with treeitems of a treeview. There are expand and collapse icon-arrows, when you have child-treeitems. I only know how to change the background-color of this expand/collapse icons. But I don't know how to change the color of the arrow. .tree-cell .tree-disclosure-node { -fx-background-color: #CCCCCC; }...

JavaFX TextArea get caret position from coordinate

java,javafx,textarea,javafx-8
Is it possible to get the caret position (an int) at a screen coordinate (2 double) in JavaFX TextArea?

compare items of 2 comboboxes

combobox,javafx,javafx-8
I want to compare the items of 2 comboboxes. Lets say combobox1 has the items ("a", "b", "c", "d") and combobox2 has the items ("b", "c"). I want to check the items and remove them from combobox1 if there is equality. So after comparison combobox1 should have the items ("a",...

Add Layouts on TabPane JavaFX

java,user-interface,javafx,tabpanel
i have a quick question. I want to build an UI with JavaFX. It should have tabs, each with some content. The problem that I have is, I dont know how to arrange the content in the tabs properly. Is there a possibility to add a Layout to the tabs?...

How would I connect to a MySQL database back-end from an Android device's application? [closed]

java,android,mysql,javafx,apk
I have developed a standalone JavaFx application in Netbeans with a MySQL database back-end which I want to also package as an APK package for running on Android. How would I go about porting the MySQL database script it uses to Android?

Javafx: Close alert box (or, any dialog box) programatically

javafx,dialog
I have a JavaFx application in which I display an alert box using: alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Title"); alert.setHeaderText("Some Text"); alert.setContentText("Choose your option."); buttonTypeOne = new ButtonType("Yes"); buttonTypeCancel = new ButtonType("No", ButtonData.CANCEL_CLOSE); alert.getButtonTypes().setAll(buttonTypeOne, buttonTypeCancel); Optional<ButtonType> result = alert.showAndWait(); Because the alert executesshowAndWait, so it will be displayed till the user...

How to make a Javafx Image Crop App

java,image,canvas,graphics,javafx
I am building an application for my colleagues to crop image. I use FXML with Scene Builder to build the GUI. The user click a button to choose a image from his computer. Then, the image is shown in the GUI. User can zoom and move in the pane. At...

JavaFX8 : Single Controller for 1+1popup scene (Solved)

java,javafx,fxml
After following the tutorial at http://www.javafxtutorials.com/tutorials/switching-to-different-screens-in-javafx-and-fxml/, I have a functioning popup window, however, I am having difficulty figuring out how to interact with it with a controller. From the tutorial, I got the impression that there is to be a shared controller between the two FXML files, but I'm having...

JavaFx: parent.lookup returns null

java,javafx
I use osgi+cdi and I have the following code: Parent parent=null; FXMLLoader fxmlLoader=getFxmlLoader(); try { parent = (Parent)fxmlLoader.load(getFxmlStream("tasklist.fxml")); } catch (IOException ex) { Logger.getLogger(TestGoView.class.getName()).log(Level.SEVERE, null, ex); } ComboBox comboBox=(ComboBox) parent.lookup("#testComboBox"); if (comboBox==null){ System.out.println("COMBOBOX NULL"); }else{ System.out.println("COMBOBOX NOT NULL"); } And I have the following tasklist.fxml <VBox maxHeight="1.7976931348623157E308"...

JavaFx table view, table gateway pattern and join

java,design-patterns,javafx
For working with data from database I implemented table data gateway. So, I have two tables: CREATE TABLE student ( id INT, id groupId, name VARCHAR(100), surname VARCHAR(100) ); CREATE TABLE group ( id INT, name VARCHAR(100) ); And I have two DTO. It's strictly that one DTO for one...

javafx collision issue between path(line) with thick stroke and circle [duplicate]

java,javafx,collision-detection,intersect,stroke
This question already has an answer here: Checking Collision of Shapes with JavaFX 1 answer I am using JavaFx 8 library. My task is simple: I want to check if circle collides with a path that has a thick stroke around it. The problem is that both functions Path.intersect()...

Rotate line segment with Button

math,javafx,geometry,coordinates
I have a line which has points (x1,y1) and (x2,y2). I wanted to attach a Button to it, it should align with the line by rotating based on the line segment points. I need some help in calculating the rotation angle for the Button.

JavaFX: Artifact displays empty window only

java,eclipse,intellij-idea,javafx
Preface: I am pretty new to JavaFX Made an simple image resizing application and need to build an artifact of the application. Using IntelliJ and Eclipse (tried both), i built normal JAR artifacts and JavaFX artifacts. Both are executable, but only show an empty window. When starting the application out...

How to change ImageView on KeyPressed

javafx
I am having difficulty trying to solve this, I am currently trying to figure out how to change the ImageView to another ImageView when I press a certain Key on my keyboard but I have no idea how to, I have already looked around almost everywhere I can think of...

Where can I find the JavaFX 8 source code for skin classes?

javafx,javafx-8
For example, TextFieldSkin, ButtonSkin etc. I searched in repositories mentioned in this SO question, but can't find anything.

How to accomplish 3 horizontal line menu in fxml

menu,javafx,overlay,fxml
I want to create menu like "Firefox (Three horizontal line - top right side) Menu". I don't know how to create this line of overlay menu in FXML. Have anybody any idea about this? Thank a lot....

Why JavaFX requires Platform.runLater to change anything in it's UI inside a thread?

java,multithreading,swing,javafx
This code of a simple swing application: final JFrame jFrame = new JFrame(); final JLabel jLabel = new JLabel("Test"); jFrame.add(jLabel); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jFrame.pack(); jFrame.setLocationRelativeTo(null); jFrame.setVisible(true); Thread thread = new Thread(){ @Override public void run() { while(true) { jLabel.setText("Time: " + System.currentTimeMillis()); try { Thread.sleep(1000);} catch(Exception ex) {} } } }; thread.setDaemon(true);...

Java for Mobile and Desktop Development

java,javafx
I took several courses and learned the basic syntax of Java. I'm wondering which Java tools should I study if I want to develop desktop and mobile applications? I'm learning javafx now. Is this primarily used for desktop development or will it help me in Mobile Android development as well?If...

JavaFX ScrollPane - Check which components are displayed

javafx,listener,javafx-8,visible,scrollpane
I wonder whether there is a ScrollPane property in JavaFX 8 that can be used to listen on the components that are currently displayed at a given time. For example, ScrollPane has a VBox which has 8 buttons. Only 4 buttons can be seen in scrollpane. I would like a...

javafx position elements around a central point

java,javafx,javafx-8
Apologies, as this is a rubbishy asked question, but I am totally flumped here about the best approach. I believe there must be something inbuilt or common practice for this but I can't find it and Google has turned up nothing of much value. I have a javafx scene with...

Swing JTextPane in javafx

java,swing,javafx
I'm looking for a rich textarea in javafx. I have tried the RichTextFX component by Tomas Mikula but it is too buggy for my needs. I was thinking whether it would be possible to plug in a swing JTextPane using the SwingNode class. So far it actually works as in,...

JavaFx: hide textfield in editable cell when focus leaves table

java,javafx
When user wants to edit a cell then a text field appears in this cell. How can I hide this textfield (close it) when user click something outside the table?

How to change collapse and expand icon for a particular treeview in javafx?

css,javafx,treeview
I need to apply CSS to change collapse/expand icons for a particular treeview in my JavaFX application. FX:ID for it is treeView. However I have many other treeviews in my application and I don't want those icons to be changed. Change expand and collapse image TreeView JavaFX 2.2 Above link...

Getting a mouse position with JavaFX and Event

java,javafx
I'm trying to get the position of a mouse click in my JavaFX application. I have an EventHandler as so: EventHandler<Event> mouseHandler = new EventHandler<Event>() { @Override public void handle(Event event) { String eType = event.getEventType().toString(); if(eType.equals("MOUSE_PRESSED")){ //mouse position } } }; which is called on mouse press, release and...

Java BufferedReader - empty line issue

java,file,javafx,line,bufferedreader
Problem description: For example we have a text file file.txt with following content: Hello(LS) what(LS) are(LS) <empty_line>(LS) you(LS) doing(LS) <empty_line>(LS) <empty_line>(LS) now(LS) <empty_line>(LS) <empty_line>(LS) <empty_line>(EOF) (LS - line separator, EOF - end of file) If I understood the idea of text file, the file is looking something like that. Now,...

JAVAFX error incompatible types: FXMLLoader cannot be converted to node

javafx
I am new to Java and JavaFX. I am trying to develop an CRUD application for employee data. I am adding the FXML file into a tab. The code is as follows. tabEmployee.setContent((Node) FXMLLoader.load(getClass().getResource("EmployeeOverview.fxml"))); This works fine but when I try to do the same as follows private URL URLEmployeeOverview...

How to make javafx label fit text?

user-interface,javafx
I have a dialog window for adding records to the table. As far as I don't want to create for example 10 fxml files for each table I have only one: <?import javafx.geometry.*?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import com.sun.javafx.scene.control.skin.IntegerField?> <?import javafx.scene.layout.ColumnConstraints?> <GridPane alignment="BASELINE_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"...

JavaFX - how to get background color of Tab, Button, etc

java,animation,colors,javafx,background
Problem description: I can't get background of object in JavaFX. I don't mean Shapes, but normal Nodes like Buttons, Tabs and others. I don't know how to access to theirs background color. What I want? I am developing IDE and I want to run Color animation on tab with file...

JavaFX Tooltip - border color bug

java,css,javafx,tooltip,border
I have a problem with Tooltips in JavaFX. For illustration the core of this problem I created new JavaFX project through IntelliJ Idea. Root pane of that project is HBox with alignment="CENTER" and that HBox contains four buttons (text: Button A-D). Every button has set Tooltip with text: Sample tooltip...

Spring JavaFX @Transactional entitymanager is closed

spring,exception,javafx,transactions,transactional
i'm stuck on a Transactional Problem using Spring @Transactional with a JavaFX application, all my beans, and graphical components are managed by spring. I initialize my appusing @PostConstruct on my Controllers. In the PostConstruct, all my daos are working perfectly but when i invoke a service to save something by...

JavaFX load image from external folder

java,image,javafx,path,folder
I need some help with importing Images to my JavaFx application: My image has the path : /sprinter/ExternalSprinterFolder/Maps/map_asteroid/map_asteroid.jpg My GUI code has the path: /sprinter/src/de/sprinter/gameclient/gui/SelectSectorGui.java I tried already a lot but I can't load the image... I tried for example: File file = new File(imagePath); Image image = new Image(file.toURI().toString());...

Having trouble retreiving value from tableview

javafx,tableview
I'm having having trouble getting a correct output from tableview. I'm using a button to set one item from tableview to a label. However, it prints "StringProperty [Value pineapples]" where I would like it to be just "pineapples". The tableview gives them correctly. Can anyone enlighten me on this one?...

How to make a listview cells not traversable with arrow keys?

listview,javafx,javafx-2,javafx-8
I have a ListView and would like to disable the traversal with arrow keys so that only a MouseEvent would change the selected item. I was going to use a TraversalEngine, but it seems as though that is deprecated. What is the best way to prevent the traversal? I get...

JavaFX : Button never sets a graphic

java,javafx,controller
EDIT : A MCVE version of my code has been made to help debug it. It reproduces my bug. The purpose of my code is doing a Memory game. Which means that when it is your turn, you "open" a card, then another one. If they form a pair, they...

Applying CSS to JavaFX TextAreas

css,javafx
I want to change the background color of a TextArea using CSS. I'm using this line: -fx-control-inner-background: #00FF99; The problem is that the TextArea only displays this color when it has focus. I know TextAreas are composed of several different Nodes. Do I have to alter another one to make...

is it possible to set a javaFX Pane origin to bottom-left?

java,javafx
i already searched for this problem, but couldn't find an answer. so sorry in advance if this question was already asked. is it possible so set the origin of a Pane to the bottom-left corner (instead of top-left) ? i'm adding many shapes to my canvas which are defined within...

Retrieve date from DatePicker and move to another FXML file

javafx,datepicker
I got a question about passing a selected date from DatePicker to another FXML file. I’ve seen code in similar threads but I can’t seem to get my head around it. Basically I want to select a date from DatePicker (in DiscountController) and be able to retrieve that selected date...

position of TableColumn in Scene

javafx,javafx-8
I have a TableView with several TableColumns and I want to place a Node below a certain TableColumn. How do I get the exact position (x,y-coordinates) of the TableColumn so I can bind the translate properties of my node? Here is a snippet of how I placed a button on...

JavaFx: object property adapter

java,javafx
For DTO I use POJO. So to make bidirectional binding I create adapter. The problem I don't know how to use ObjectProperty listenet. So I have the DTO - I inform JavaFx properties via listener: public class Temp{ private BigDecimal weight; private final PropertyChangeSupport propertyChangeSupport; public Temp() { this.propertyChangeSupport =...

JavaFX: How can I horizontally center an ImageView inside a ScrollPane?

javafx,imageview,scrollpane
viewScroll.setContent(new ImageView(bigimg)); double w = viewScroll.getContent().getBoundsInLocal().getWidth(); double vw = viewScroll.getViewportBounds().getWidth(); viewScroll.getContent().setTranslateX((vw/2)-(w/2)); viewScroll.toFront(); I set an ImageView with some Image inside the ScrollPane but the ImageView always goes to the far left corner. Here I'm trying to manually offset the difference, but it doesn't work well. The ImageView goes too far...

Difference between Pane and Group

javafx,group,pane
My question is simple : in JavaFX, what is the difference between a Pane and a Group ? I can't make any difference ... Thank for your answer...

How to identify web actions in JavaFX webview?

javascript,webview,javafx
I need to catch the actions like clicks, drag, right-click, double click etc, that are done by the user on JavaFX web view. How to achieve it?

FX - Suggestions for aligning CheckBox in Grid

java,checkbox,javafx,grid,alignment
Converting from Swing to FX here. We have some CheckBoxes where the Label appears on the left side of the CheckBox. We are accomplishing this by calling setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT); The problem is that in some GridPanes, we'll have a Label in column 0 with a Node in column 1 on row...