javafx-8

Triggering asynchronous event in gui thread

假装没事ソ 提交于 2019-12-31 07:47:06
问题 TL;DR I'm looking for a way to have one thread raise an event in another EDIT: I say the word "immediate", which is, as some commenters have pointed out, impossible. What I mean is that it should happen reasonably quickly, in the low milli to nanosecond range if the gui thread is idle (which , if I do my job right, it should be). The case example: I have a project which has a Parent class. That Parent class creates a child thread 'Gui', which houses a javafx application and implements

Update JavaFX Live nodes outside Application Thread

陌路散爱 提交于 2019-12-31 07:39:05
问题 The JavaFX Application Thread. Sources I can find says all updates on nodes must happen in this thread. I am trying to find the documentation for this and if there are any exceptions to this rule. https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/concurrency.htm As it says: The JavaFX scene graph, which represents the graphical user interface of a JavaFX application, is not thread-safe and can only be accessed and modified from the UI thread also known as the JavaFX

child fxml file not loading to parent fxml

有些话、适合烂在心里 提交于 2019-12-31 07:17:46
问题 hello guys i m new to fxml so please ignore my silly question here are few things which i m try for 2 day but got not success remove white space from table i.e table size should be up to number of available row(number of row varies) when user click on table row(any display value) new fxml file is open in Anchor pane(tableview is displayed) allotted for tableview but i want to display it in main view (where whole thing table and 2 text field and search button behind this main stack i want to

Java Fx resizing scene to stage

和自甴很熟 提交于 2019-12-31 07:03:11
问题 I searched but could not find anything close to the problem that I am having with Fx. I am using Java Fx/JDK 8 and having problems with resizing the scene(s). The below code below loads only one screen at a time in scene graph, and switches between the screens. The problem is when I resize the stage. The scene is not being resized with the stage. Nothing fancy in FXML files only anchor pane and a few components.Thanks in advance. public class ScreensFramework extends Application { static

In JavaFX how to add combobox with data in table view

家住魔仙堡 提交于 2019-12-31 05:57:05
问题 I have tried a lot but not able to populate all values in the data base into my combo box table cell. Controller.java public class controller { GetConnection gc = new GetConnection(); PreparedStatement pst; ResultSet rs; Statement st; private ObservableList<Users> datas = FXCollections.observableArrayList(); public controller() { } @FXML private TableView<Users> table; @FXML private TableColumn<Users, String> c1; @FXML private void editable() { List<String> names = new ArrayList<String>();

Wait() & Sleep() Not Working As Thought

牧云@^-^@ 提交于 2019-12-31 05:26:15
问题 Using JavaFX 8.0 and JRE 1.8.0 u45 in IntelliJ, I created a basic pixel editor app. I have two windows(stages). One is a 32x128 matrix of Circle Objects placed in a Grid Pane and the other, a Tools widow; I have one Controller.java . Using the mouse, the Tools window provides tools to draw lines, rectangles, etc. and a menu for Setup, Files and Playlists. The Files menu presents the user with Open, SaveAs and Delete. To view a saved pixel art file, the user clicks Open and via the

JavaFX : TableView inside Dialog has duplicate items

 ̄綄美尐妖づ 提交于 2019-12-31 05:20:10
问题 I have an issue with my TableView and its items. I have created a small Dialog window to display warnings about my app, and inside the Dialog I have a TableView which displays the name of the warning and some information about it upon clicking on a button. I have created a WarningUtil class ( Singleton pattern) just to open / close the Dialog . The relevant code follows. The constructor of the WarningUtil class (called once only) : private WarningUtil(RootCtrl rootCtrl) { this.rootCtrl =

JavaFX: Handle ComboBox selection event which is inside the TableView Column

此生再无相见时 提交于 2019-12-31 04:39:09
问题 I have a javafx TableView and I want custom controls inside the columns. Say I want a TextField in column1 and ComboBox in column2 and DatePicker in column3 . I know that I should create a class that extends TableCell and override the updateItem() method.... But I read that specifically for this purpose we have default classes like ComboBoxTableCell , TextFieldTableCell etc in the cell package and it is recommended to use them. So I'm able to achieve this with the below code.

Linear gradient's bounds computation takes parent's bounds in account, not the node on which it is applied on

。_饼干妹妹 提交于 2019-12-31 04:23:05
问题 I want to put a linear gradient on a line(width wise ie across it's stroke width). This line is a child of a Group node. When I apply linear gradient on line, the color stops are calculated using Group's bounds not the lines bounds. In my code below, linear gradient will show up properly when added length-wise ie "to bottom", but not when added width wise, ie "to right". Can anyone tell me what can be work around for this? Here is the SSCCE import javafx.application.Application; import javafx

JavaFX (8) Alert: different button sizes

旧街凉风 提交于 2019-12-31 04:17:13
问题 Consider a JavaFX (8) Alert dialog with two buttons: Alert alert = new Alert(AlertType.CONFIRMATION); ButtonType bttYes = new ButtonType("Yes"); ButtonType bttNo = new ButtonType("No, continue without restart"); alert.getButtonTypes().clear(); alert.getButtonTypes().addAll(bttYes, bttNo); alert.showAndWait(); The resulting dialog has two buttons, both same width which looks quite silly. Is there a way to adjust both buttons to the actual text length? 回答1: An Alert , which extends Dialog ,