Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find an element with an ID in JavaFX?

Tags:

java

javafx

I have an element with the ID history type of TableView. How can I find and access this object if I have the instance of Scene scene?

like image 572
Tower Avatar asked Aug 30 '12 16:08

Tower


People also ask

What is FX ID in JavaFX?

The fx:id attribute is a unique identifier of a component, which can be used to reference the component from other parts of our FXML and even our Controller.

How do coordinates work in JavaFX?

Each JavaFX Node has its own cartesian coordinate system. The only difference from a regular cartesian coordinate system is that the Y axis is reversed. That means, that the origo of the coordinate system is in the upper left corner of the coordinate system.

What is a node in JavaFX?

Each item in the scene graph is called a Node . Branch nodes are of type Parent , whose concrete subclasses are Group , Region , and Control , or subclasses thereof. Leaf nodes are classes such as Rectangle , Text , ImageView , MediaView , or other such leaf classes which cannot have children.

How many parents does a JavaFX scene have?

Every Scene needs exactly one Parent as the root .


1 Answers

Try

TableView tb = (TableView) scene.lookup("#history"); 
like image 159
Uluk Biy Avatar answered Sep 29 '22 17:09

Uluk Biy