FAQ Database Discussion Community


Change JavaFX Tab-Button orderring of TextFields from “Left to Right” to “Right to Left” by fxml file [duplicate]

java,javafx,javafx-8,scenebuilder,keyboardfocusmanager
This question already has an answer here: JavaFX: How to change the focus traversal policy? 6 answers Before asking, i should say that the answer of can be found maybe in JavaFX: How to change the focus traversal policy?, but i don't looking for any java code, i would...

When does Vbox/Hbox assign coordinate for it's children?

java,javafx,java-8,javafx-8,vbox
I put rectangle on a vbox on click and I print coordinate of the rectangle. On key pressed I only print the coordinate. Look at this sample code example : @FXML private VBox vbox; @FXML private AnchorPane anchorpane; private List<Rectangle> rectangles = new ArrayList<>(); @Override public void initialize(URL location, ResourceBundle...

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...

Quadrant Scatter Chart in JavaFX?

java,charts,javafx-8,scatter
thanks for reading my question. I'm currently working with JavaFX-8, SceneBuilder and Eclipse. I want to do a scatter chart with four quadrants, that has two fixed number axis (the data position is not relevant, I only need to display the dots on each quadrant... only matters in which quadrant...

How to use predefined Spinner style classes in FXML

java,javafx-8,fxml,javafx-css
According to this Link javaFX 8u45 spinner, can be styled in numerous ways via style class. I do know how to do it by code. For example: spinner.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL); or, spinner.getStyleClass().add("split-arrows-horizontal"); However, not by fxml. I did try this, but it did not work. I did this via scenebuilder, version 8....

JavaFx call event handler from node

javafx,javafx-8,fxml
I'am trying to do one custom system of shortcuts for special need in javaFx. This special need make it's not possible to use KeyCombinaison (limitation of only one key + modifier is not acceptable). I have do my proper KeyCombinaison system and now I want to call one handler from...

How to center the content of a javafx 8 scrollpane

javafx-8
I have a ScrollPane, which contains a GridPane, which contains an ImageView, which contains an Image. What I want is for the Image to be centered in the GridPane. Without the ScrollPane I was able to accomplish this with setAlignment(Pos.TOP_CENTER), however once I added the GridPane to the ScrollPane the...

Handle event on disabled Node

javafx,javafx-8
Is there any way to handle, mouse click, for example on disabled element? My task is to have disabled list and make it enabled after double click on it.

Remove left padding of Alert

javafx,alert,javafx-8,padding
Consider this sample program which is adding a TabPane into an Alert. As you will see, there is a white padding on the left of the TabPane that I just cannot remove. If anyone has any idea it will be great. Code: import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Alert;...

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...

JavaFX TextArea right alignment

java,javafx-8,text-alignment
I tried to use the TextArea component to let user write multi-line text, but the problem that I can't set the text alignment to right. By default it starts in the left. The text will be in Hebrew or Arabic, so I need the user to write in the TextArea...

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 8 Localization of dialog's internal elements

java,javafx,localization,javafx-8
I am currently developing a JavaFX application with Slovak language localization and inside the application I am using an Alert dialog for showing exceptions with expandable content pane as shown below on images: I would like to have this dialog completely translated which is going well with Header, Title or...

Drag and Drop from ListView to TreeView

java,javafx,drag-and-drop,javafx-8
I just want to drag and drop an item from my ListView to a specific position in my TreeView. I know how to handle DragEvents. But how can I get the dropped position of my treeView? With "position" I mean "on which treeview-item dropped (get reference from this treeview-item)". package...

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!

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....

InvocationTargetException in FXMLLoader in SpringFramework Project

java,spring,javafx-8,autowired,fxmlloader
Hello StackOverflowers, I am working on a Ticket Sales Program using (among others) the Spring Framework. I am getting a very interesting InvocationTargetException which is caused by a NullpointerException. When I checked with the Debugger (IDE IntelliJ) however, the line at which the Nullpointer is thrown, there is nothing null....

Save JavaFX ScrollPane content to PDF file

itext,javafx-8
I'm using the below code to save the content of a ScrollPane in my JavaFx Application to a PDF file. button.setOnMouseClicked(new EventHandler<MouseEvent>() { public void handle(MouseEvent event) { File pdfFile = fileChooser.showSaveDialog(primaryStage); try { BufferedImage bufImage = SwingFXUtils.fromFXImage(scrollPane.snapshot(new SnapshotParameters(), null), null); FileOutputStream out = new FileOutputStream(new File("../temp.jpg")); javax.imageio.ImageIO.write(bufImage, "jpg", out);...

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...

How to pass data from JavaScript to JavaFX

java,javascript,javafx-8
In my JavaFX application, I have a WebView to load HTML contents. Is there a way to pass Javascript variables and manipulate it in JavaFX App. Let's say I have a variable FULLNAME in Javascript and I want to display it in a TextField in JavaFX. Is it possible? Can...

javaFX custom control undesired behavior

java,javafx,javafx-8
this custom control is a padlock. what i want is that when i mouse click it the upper part should rotate and the bottom part should remain still. right now when i do it the bottom part also moves and i dont understand why. could someone help me to find...

JavaFX: how to handle dragging an item from a TreeView

java,treeview,javafx-8
For an application I'm developing I have a TreeView with (my own type of) TreeItems. This is working fine, and I get the items to display as expected. I now want to be able to handle dragging an item from this TreeView to another part of the app window and...

Efficiently updating lines/markers on top of a JavaFX chart

java,javafx-2,javafx-8
I use a JavaFX LineChart which takes nearly a second to be rendered and I want to move a vertical marker (cursor position) over this chart which is updated very frequently. I tested the following solutions: Adding a line in a JavaFX chart How to add a value marker to...

Javafx Tree Table view: how to assign serial number to the direct child nodes of the root node

javafx,javafx-8
I am trying to number the direct child nodes of the root node in a serial manner (child-1, child-2...). Here is my method which sets the cell value factory for myColumn: private void setCellValueFactory() { myColumn.setPrefWidth(120); final int[] si_SubsetCount = { 1 }; myColumn.setCellValueFactory( (TreeTableColumn.CellDataFeatures < MyDataClass, String > p)...

How to get the correct text value from a button javafx

java,javafx,javafx-8,conditional-statements
I have been trying to use the name of a button in a conditional , checking if the string generated from .getText()is or is not equal to "New Project:" in the case below, but every time i try to run this code it always gives me a result of 'not...

JavaFX set empty value on “other” ComboBox value?

java,javafx-8
I'd like to make "other" item in drop-down menu, with ability to just set empty value to Language when it chosen? Now it just assigns other. And also can I somehow dim "other" item in drop-down menu? ...

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,...

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()...

Change chart color based on ColorPicker input

javafx,javafx-8
I would like to change line color based on ColorPicker input during runtime. import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.logging.Level; import java.util.logging.Logger; import javafx.animation.AnimationTimer; import javafx.animation.Timeline; import javafx.application.Application; import javafx.event.Event; import javafx.event.EventHandler; import javafx.scene.Scene; import...

How to create an inner popup in JavaFX styled with FXML

javafx,javafx-2,javafx-8,javafx-1
I have an FXML file that I'm using to allow user input when requested. Right now I just put it in a new stage and do Stage.show(). I would like to not have it appear in a new window and behave more like a ContextMenu. Looking at ContextMenu class it...

How to update node state in JavaFX?

java,javafx,javafx-8
public Card(Suit suit, Rank rankString, boolean hide) { this.suit = suit; this.rankString = rankString; this.hide = hide; if (!this.hide) { HashMap<String, String> map = cardNames(); String thisCard = suit.toString()+rankString.toString(); Image cardDP = new Image("file:E:/Javaworkspace/Project/resource/"+ map.get(thisCard) +".png"); ImageView iv = new ImageView(); iv.setImage(cardDP); getChildren().add(new StackPane(iv)); } else { Image img =...

Changing the text of a label from a different class in JavaFX

javafx,javafx-8,fxml,fxmlloader
This question was already asked here but was not able to find any answers. I have reproduced a similar situation where I would like to change the text of a label from another class using the controller FXMLDocumentController.java public class FXMLDocumentController implements Initializable { @FXML private Label label; @FXML private...

JavaFX overwrite object

java,javafx,javafx-8
I'm trying to create a chess game using JavaFX and I found making the match history quite tricky, after succesful print of the history I'm trying to add posibility to go back to some board state. I tried this way, but it wouldn't work: The first part is a snippet...

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...

Configured androidSdk is invalid (Deploying JavaFX to Android)

java,android,javafx-8
I developed a small JavaFX Application and I want to run it in my Android Phone. I followed the tutorial here, unfortunately, after invoking gradlew androidinstall, an error shows up. It says Configured androidSdk is invalid. I swear the android directory is set to right path which is C:\Program Files\android-sdk-windows(Please...

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...

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.

In JavaFX how can I programmatically scroll a Scrollpane to the bottom?

java,javafx-8
I have been working on a small chat client for me and some friends, teaching myself Java and JFX 8 on the side. Unfortunately, for some reason I am unable to programmatically scroll to the bottom of a ScrollPane where the chat messages are. I have a method I simply...

Clear only the visible data data from Chart

javafx,javafx-8
I have this example of javaFX LineChart. I would like to reset the data into the chart. public class MainApp extends Application { private static final int MAX_DATA_POINTS = 50; private Series series; private int xSeriesData = 0; private final ConcurrentLinkedQueue<Number> dataQ = new ConcurrentLinkedQueue<>(); private ExecutorService executor; private AddToQueue...

Get series names from LineChart object

java,javafx,javafx-8,linechart,series
For example I created Linechart and added series this way: LineChart lineChart = new LineChart(); XYChart.Series series = new XYChart.Series(); series1.getData().add("Name1", xValue1[], yValue1[]); series2.getData().add("Name2", xValue2[], yValue2[]); lineChart.getData().add(series1); lineChart.getData().add(series2); If after that I send lineChart to other class, how can I get series names (Name1 and Name2) using lineChart object from...

Value Change Listener to JavaFX's TextField

java,javafx,javafx-8,documentlistener
I would like to add a kind of listener to my JavaFX's TextField which when ever a user changes the value of the TextField, the Application prints something on the console. I've searched and i find the following very similar question : Value Change Listener to JTextField The answer of...

JavaFX 8 MapProperty unbind does not work?

java,javafx-8,property-binding
Can anyone explain me if this is a bug or am I missing something in JavaFX MapProperty binding? Scenario: Two MapProperty instances - master and child. At first we bind child to master Then we store some values in master Unbind child from master Clear child both instances are empty...

JavaFX 8 Transform to pitch, yaw and roll rotation angles

matrix,3d,rotation,javafx-8
Implementing the answer from this thread I have this code that translates the deltayaw, deltaroll and deltapitch angles into one angle and rotates a node around it. The angles that are taken as the parameters are momentary changes of angles since giving the whole angles would ignore the changes in...

Handle pagination with page factory

java,javafx,pagination,javafx-8
I have a table view with an anchor pane panel with 2 children, a table view and a pagination. The pagination is not directly linked to the table view (like if you put a button with a label that gets updated). The only examples I found is that the pagination...

How to enabled up/down keys in a JavaFX Spinner component

java,spinner,javafx-8
I'm using a Spinner component in my JavaFX application. It's created via FXML: <Spinner fx:id="spinner" editable="true" min="0" max="100" initialValue="3" /> According to the documentation of Spinner: The keyboard up/down arrow keys also cycle through the elements. However, when I click in the spinner component and press UP or DOWN only...

Set Printer PageLayout margin to zero

java,javafx,javafx-8
I created a small Javafx application that allows the user to print a node. I want the margin to be zero. I used the following code below, but it didn't work. printer = javafx.print.Printer.getDefaultPrinter(); pageLayout = printer.createPageLayout(Paper.JAPANESE_POSTCARD, PageOrientation.PORTRAIT, 0.0f, 0.0f, 0.0f, 0.0f); According to the documentation, the last four parameters...

Place MeshVIew in Scene

java,javafx,javafx-8,mesh,javafx-3d
I want to display a 3D figures on a MeshView in JavaFX. Since I want to build a simple model viewer I created tabs for clarity. One of them contains a group (meshGroup) where I add a SubScene (with the MeshView in a group) on runtime. I'm not able to...

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...

Invoke a ComboBox's enter key/action event handler regardless of value property change

java,combobox,javafx,javafx-8
With an editable ComboBox, is there any way to have the ENTER key event or action event handler occur regardless of whether or not the Combobox's value property has changed? I essentially would like to have the same behaviour in a ComboBox's TextField on pressing the ENTER key as it...

“Error: Could not find or load main class” JavaFX Terminal

java,ubuntu,javafx,terminal,javafx-8
I'm using the following class from my JavaFX Tutorial: import javafx.application.Application; import javafx.stage.Stage; public class HelloFXApp extends Application { public static void main(String[] args) { // Launch the JavaFX application Application.launch(args); } @Override public void start(Stage stage) { stage.setTitle("Hello JavaFX Application"); stage.show(); } } I'm using Ubuntu and I have...

How to set the letter spacing (aka tracking) of a Font in JavaFX?

java,javafx-2,javafx-8
The internet teaches me it was available in JavaFX 1.x (most examples I found, were in the .fx format, which is now obsolete). But it now (JavaFX 2.*) seems impossible to do. I can think of one way for accomplishing the effect I want: stuff every letter in a Text...

How to “add” two Triangle Meshes together in javafx?

javafx,3d,javafx-8,javafx-3d
I am making a 3D model of the volume generated by two functions: one as the base (in intersection of the x-axis), and the other as the height of the volume.This is achieved by approximating the volume of small parts, drawing that mesh, then adding all of the meshes together....

Setting background color of each character in textArea

javafx,javafx-8
I'am new to JavaFX. I want to do something like in the following image inside my TextArea. I think it can be done using the Label and set the background color of it. But how? ...

NetBeans bug showing on example code in book “Pro JavaFX 8: A Definitive Guide” initializing objects in FXML file

java,javafx,javafx-8,fxml
In Chapter 3 of "Pro JavaFX 8: A Definitive Guide to Building Desktop, Mobile, and Embedded Java Clients", an example illustrating how to specify objects directly in an FXML file generates errors in NetBeans 8.0.2 (I downloaded the code from the book's site and all other examples I tried so...

CheckComboBox choices are empty

javafx,javafx-2,javafx-8,fxml
Hi I am learning javafx and I want to create a dropdown with multiple select. I think I need to use CheckComboBox. I implement it but did no show the elements. Here`s my code: In fxml : <CheckComboBox fx:id="keywordBox" layoutX="233.0" layoutY="240.0" prefHeight="25.0" prefWidth="131.0" /> In controller: @Override public void initialize(URL...

XYChart.Series.getData().clear() throws IndexOutOfBoundsException

java,javafx,javafx-8
When I try to clear my collection (link to a lineChart), I have an IndexOutOfBoundsException. According to an another post I try to use a Platform.runlater but the problem continues. I was wondering if someone had the same problem and how to solve it? public void loadFullData(){ System.out.println("processing"); Platform.runLater(new Runnable()...

Set custom value in ComboBox

java,javafx-8
I have ComboBox which I would like to use to configure Service delay period: import javafx.application.Application; import static javafx.application.Application.launch; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.stage.Stage; import javafx.util.Duration; public class MainApp extends...

JavaFx dialog doesn't show all content text

java,javafx,javafx-8
I have the following dialog: The last line shows only part of the text - the text is cut and instead of text "..." is shown. How can I make the dialog show all text? EDIT 1 This is the code Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Выход из программы"); alert.setHeaderText("Вы...

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...

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;"); } ...

Getting a custom class to be recognized as an fxml tag

javafx-2,javafx-8,fxml
I have a custom textfield, PersistentPromptTextField that extends TextField and would like to be able to add it my .fxml file. When I do and I run it, I get a list of errors such as this: Caused by: java.lang.InstantiationException: gui.PersistentPromptTextField at java.lang.Class.newInstance(Unknown Source) at sun.reflect.misc.ReflectUtil.newInstance(Unknown Source) ... 75 more...

How to get a record (item) number column in javafx table view?

javafx,tableview,javafx-8
I have populated a JavaFX TableView with columns of a table from a MySQL database. In my TableView, the first column I have created is "Number" which is not linked to any column in MySql database table. In this column, I want to see the number of row against each...

JavaFX - How to delete a specific Node from an AnchorPane

java,javafx,javafx-8
I'm using SceneBuilder 8.0.0 and JavaFX 8. I have a Button btn and a Label lbl attached to an AnchorPane ap. When the application starts, btn and lbl are attached to ap. How can i delete one of these nodes ? (i only know clear() method which delete all the...

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...

Focus on next item in container

javafx,javafx-8
Is there a way to programmatically focus on the next focusable node in a container without directly calling on a specific component's requestFocus() method? This functionality would be similar to pressing the tab button to traverse focus between components where disabled nodes are skipped.

Adding a custom component to SceneBuilder 2.0

javafx-8,scenebuilder
I have the need to have a selection listener and select method on a pane to be able to monitor and present a highlight when a node is clicked on. I did the following: public class PaneWithSelectionListener extends Pane { private ObjectProperty<Annotation> selectedAnnotation = new SimpleObjectProperty<>(); public PaneWithSelectionListener() { super();...

JavaFX 8 Dialog Button Area

javafx,javafx-8
Please see this gist to see what I am trying to achieve: https://gist.github.com/d9e22915234e6ea34d20 The code is heavily cut down on the problem I face. As you can see when running the code there is a "miss" detected on the label or the text area (if you miss it by 5em...

JavaFX : Consuming REST service and displaying the data in front-end

java,spring,javafx,javafx-2,javafx-8
I am working on a JavaFX(On JDK8 with SceneBuilder) project which should connect with a Spring-MVC based server and I would like to access some Objects from the server and display it. I have already programmed the Spring server to give back the desired object upon request, but my unfamiliarity...

JavaFX TableView scrollTo() causing wrong row to start editing

tableview,javafx-8,scrollto
I have an editable TableView with a button that adds a new row then calls table.edit() on the first column in that row. When a user wants to add a row that will be out of the viewport, what should happen is the table scrolls the new row within the...

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",...

JavaFX Tableview not populating data to column

javafx,java-8,javafx-8
I am trying to create a TableView with 1 counter + 4 value columns. But for some unknown reason, columns val3, val4 are not getting populated in the tableview. I have updated the getVal2() method with "val3.get()", and I could see the val3 value in column of Value2. So, I...

WARNING: System can't support ConditionalFeature.SCENE3D - VMWare, Ubuntu

eclipse,ubuntu,javafx-8,vmware
I realize there is a similar question already on SO, however, that question has nothing to do with VMWare, and I would like to find out if this is more of a VMWare problem or a Linux problem in general. I receive below WARNING in eclipse when creating an animated...

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...

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(); }...

Creating a large body of text with different styles - JavaFX FXML

java,javafx,javafx-2,javafx-8,fxml
In the fxml class of my JavaFx application I want to add a large body of text using minimal components (instead of adding multiple labels per line). I would also like to create varying styles of text in the same component. What component should I use (e.g TextArea) and how...

KeyEvent on focus JavaFX FXML

java,javafx,javafx-2,javafx-8,fxml
I am currently working on an instant messaging program and have created a text for the user to enter a message in the FXML. How do I add a KeyEvent for when enter is pressed while the text field has focus. Update - Tried, but doesn't work <TextArea fx:id="area_chatInput" editable="true"...

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...

Button on MediaView JavaFX FXML

java,javafx,javafx-2,javafx-8,fxml
How would I go about creating a button on my MediaView component, such as a play button in the centre of the video that disapears when clicked. I am working with FXML so if you could give me an answer using that it would be even better.

Getting a MouseEvent to target ImageViews inside a TilePane

javafx,javafx-8
I have many ImageViews inside a TilePane, that is inside a StackPane and then a ScrollPane. There is no border, padding, or margin between the children of the TilePane so there is no chance that I'm not clicking on an ImageView. When I click on an image, I want the...

CheckBoxTreeTableCell Select All Children Under Parent Event

java,treeview,javafx-8
I'm trying to select all child check boxes from a parent root. The action is invoked when the parent check box is selected. Here's the pseudo/modified/shortened set up with scenebuilder: @FXML private TreeTableView<Info> testTable; @FXML private TreeTableColumn<Info, Boolean> checkBoxCol; Model: public class Info{ private final BooleanProperty onHold; public Info(){ this.onHold...

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...

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 : Restrict Column rearrangement on drag and drop

javafx,javafx-8
In a tree table view, we can re-arrange the columns by dragging the column headers. I want to restrict the user from dragging the first column alone. Which means my first column should be the first column all the time. Is this possible? Thanks in advance....

JavaFx 8 TreeCell Drag and Drop

drag-and-drop,treeview,javafx-8,treecell
The objective is to use drag and drop on a treeView to move the nodes on itself.I have seen several examples where the events are handled in a redefined TreeCell, but only the detected event is triggered. This is my code: public class TreeCellImpl extends TreeCell<TreeItemContent> { public TreeCellImpl() {...

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?

Show Colorpicker from Contextmenu

javafx,javafx-8
I want to show Colorpicker from Context Menu: ColorPicker colorssPicker = new ColorPicker(); final MenuItem resizeItem = new MenuItem("Option 1"); resizeItem.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { } }); final MenuItem resizesItem = new MenuItem(); resizesItem.setGraphic(colorssPicker); resizesItem.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { } }); final...

Javafx how to add content to an existing tab in fxml file dynamically

javafx-8
I have seen a lot of answers on how to add a NEW TAB to an existing tab pane of fxml file. I need to add content to an already EXISTING TAB of a tab pane. Is it possible? If yes how do I do that?

JavaFX TitledPane can't override -fx-text-fill

java,css,javafx,accordion,javafx-8
I'm trying to change the title color of my TitledPane when they are pressed, but I can't manage to do that. This is my css: .titled-pane * { -fx-background-color: transparent; } .titled-pane .title{ -fx-background-color: #666666; } .titled-pane .title:hover { -fx-background-color: #AAAAAA; } .titled-pane .title:pressed { -fx-background-color: #DDDDDD; -fx-text-fill: black; //...

Voting bar in javaFX 8

java,java-8,javafx-8,rectangles
I have a Question how can i create this in Java with live update percentage <div class="meter"> <span id="bar1" style="width: 50%">test</span> <span id="bar2" style="width: 50%">test</span> </div> You can see its a Bar (meter) lets say 1000px and two bars in it. If someone Vote for Team one bar1 is 100%...

JavaFX change color of ImageView

java,javafx,javafx-8
Hello i'm trying to change the color of an ImageView when your mouse is on it(hover) So I have a css file that contains this: .cross:hover { -fx-background-color: red; } And this is cross: @FXML private ImageView cross; I set the fx:id in the fxml file. Now nothing happens when...

How can I remove an EventFilter in JavaFX created with a lambda

lambda,event-handling,javafx-8
I would like to be able to remove an event filter which was set up with a lambda. I am not sure if this is possible? I have seen this example using inner classes: http://www.java2s.com/Tutorials/Java/JavaFX/1120__JavaFX_Event_Filter.htm However if I create my filter like so: addEventFilter(MouseEvent.MOUSE_CLICKED, event -> { PaneWithSelectionListener parent =...

How can I use Jackson to convert a javafx.scene.paint.Color to and from JSON

jackson,javafx-8
I am trying to find an example, but to no avail of how to reconstitute the javafx.scene.paint.Color JSON back into a POJO. When I create the JSON, the Color.RED is turned into this: { "annotationText" : "5/5/2015 12:18 PM", "pageNumber" : 0, "textColor" : { "red" : 1.0, "green" :...

JavaFX 8 Canvas Fonts always Bold

canvas,fonts,javafx-8
I am using a JavaFX canvas (currently using Java 8u40) to render some graphics and text. I am having a problem getting the fonts to render correctly in the canvas. It appears the font is always being drawn bold. I have an example to show the problem. First of all...

JavaFX coordinates confusion

java,javafx,javafx-8
I am really confused by different concepts of coordinates in JavaFX. As far as I know, there are 3 types of coordinates: getBoundsInLocal getBoundsInParent localToScene Given a Node "node", contained by a Group "group", recursively contained by a Scene "scene", what are the coordinates "node" to "group" and "node" to...

Which Java-Datatype is required when calling JavaScript-Method

java,javascript,webview,javafx-8
I'm trying to call a JavaScript-Method from within my JavaFX-WebView via: JSObject win = (JSObject)getEngine().executeScript("window"); win.call("showPDF", myPDFFile /*typeof java.io.File*/); the result of this call is: Invalid parameter object: need either .data, .range or .url This is the JavaScript-Part (not by me), which throws the error: var source; if (typeof src...

Changing JavaFX label using Javascript callback method

javafx-2,javafx-8,javafx-webengine
This question might be considered as a simple extension to this qeustionI have a simple application with a label and a WebView. The WebView contains a small rectangle whose onclick should invoke a method in JavaFX and change the text of a label. Following is my FXML file <?xml version="1.0"...

Can FXMLLoader factory methods be used for user-defined classes?

javafx,javafx-8,fxml,fxmlloader
In Chapter 3 of "Pro JavaFX 8: A Definitive Guide to Building Desktop, Mobile, and Embedded Java Clients", an example illustrates how to specify objects directly in an FXML file. You can find the complete FXML file, along with the other files in the example, at the end of this...

JavaFX - how to set CellFactory for specific TreeItem

javafx,treeview,javafx-8
I have a TreeView, with many TreeItem. what i want to do is that i enable modification for the selected TreeItem and disable it for others. To get all the TreeView to be modifiable i use : syTree.setEditable(true); syTree.setCellFactory(TextFieldTreeCell.forTreeView()); } syTree.setOnEditCommit(new EventHandler<TreeView.EditEvent<String>>() { @Override public void handle(TreeView.EditEvent<String> t) { syTree.getRoot().getChildren().set(syTree.getRow(t.getTreeItem()),...

Set border around imageview with no background in javafx

button,javafx,imageview,javafx-8,javafx-css
I would like to have a button or a clickable ImageView in my program. When clicked i would like to have a border to appear in a shape of the imageview. This image had no background, but i can't find a way to specify the border's shape. For example: http://vignette3.wikia.nocookie.net/forgeofempires/images/b/b8/Castel_del_Monte.png/revision/latest?cb=20130101150554...

JavaFX MediaView in FXML

java,javafx,javafx-2,javafx-8,fxml
I have tried to create a MediaView in my fxml but it does not seem to work and just brings up errors. The video I am playing is based locally. <MediaView> <MediaPlayer> <Media source="vid/video.avi"/> </MediaPlayer> </MediaView> ...