javafx

Sometimes Scene Builder in JavaFX doesn't open

社会主义新天地 提交于 2020-01-02 00:52:12
问题 It's really getting annoying and tiresome when I'm working really hard on something I need to complete and then I need to make a few changes to the GUI so I open Scene Builder and it doesn't open up. I've tried - Closing Eclipse and opening it. - Killing the scene builder process and opening it. What works - Logging off and logging on and then opening eclipse & the scene builder. This is starting to make me lose taste in JavaFX. Though I have to use this over Swing. Also, when I open Scene

Escape from a Number TextField in a JavaFX dialog

蓝咒 提交于 2020-01-02 00:44:08
问题 I've a custom dialog with several UI elements. Some TextFields are for numeric input. This dialog does not close when the escape key is hit and the focus is on any of the numeric text fields. The dialog closes fine when focus is on other TextFields which do not have this custom TextFormatter. Here's the simplified code: package application; import java.text.DecimalFormat; import java.text.ParsePosition; import javafx.application.Application; import javafx.application.Platform; import javafx

Javafx getting input from TextField

最后都变了- 提交于 2020-01-01 22:15:34
问题 This is my current code, all it does is set up a GUI interface for a calculator I made. I want the user to enter in two values and then when the "Sum" button is pressed it adds the two values together and displays it in the "Sum:" TextField. I'm experimenting with JavaFX, some help would be greatly appreciated. import javafx.application.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.*; import javafx.scene.layout.*; import javafx.geometry.*; import javafx.event.*;

Lazy-loading items in TableView

梦想与她 提交于 2020-01-01 22:15:23
问题 I am implementing a custom TableCellFactory to load data asynchronously from a database. Querying the db should not block the UI thread. public abstract class AsynchronousTableCellFactory<E, T> implements Callback<TableColumn<E, T>, TableCell<E, T>> { private static final Executor exe1 = Executors.newFixedThreadPool(2); private static final Executor exe2 = Executors.newFixedThreadPool(2); @Override public TableCell<E, T> call(final TableColumn<E, T> param) { final TableCell<E, T> cell = new

JavaFX, ObservableList: How to fire an InvalidationListener whenever an object of the list gets modified?

笑着哭i 提交于 2020-01-01 19:30:44
问题 Say I have a JavaFX app with an observable class SomeObservableClass with some Properties: public class SomeObservableClass{ private StringProperty prop1 = new SimpleStringProperty(); private DoubleProperty prop2 = new SimpleDoubleProperty(); ... constructors, getters and setters } and another class which has a property: public class ParentClass{ private ObservableList<SomeObservableClass> sOC = FXCollections.observableArrayList();` } In this parent class I add a listener for the observable

JavaFX strange menu accelerator behaviour

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 19:24:48
问题 I noticed a really strange behaviour with menu accelerators on the JavaFX (system) menu. Some key combinations don't work at all and others are interpreted as the wrong key. For instance, when you use the CMD+CLEAR key as accelerator, it gets changed as the CMD+Page Down down key (both in the menu text and in the actual response to a keyboard event). The '-' (MINUS) key doesn't work well at all and while, CMD + - shows up well in the menu, it never gets triggered when you press the keys. When

JavaFX buttons don't disable

百般思念 提交于 2020-01-01 18:20:50
问题 I have a task that can take a few seconds to a few minutes, and when I click on the button to execute the task, it runs the task but does not always disable button A and enable button B . Here is the code that I am using: @FXML public void onExecute(ActionEvent event){ btnExecute.setDisable(true); btnStopExec.setDisable(false); new Thread(){ @Override public void run(){ Platform.runLater(() -> { QueryTable qt = new QueryTable(currentMysqlConn, currentDatabase); qt.setTabPane(resultsTabPane);

javafx listview with button in each cell

强颜欢笑 提交于 2020-01-01 14:41:15
问题 I have a javafx application which contains a listview with a custom cell factory. each cell contains a button to do a specific action for that cell. before updating to java 8 every thing was ok but after running my app with java 8 when i click the button instead of handling event by button, the whole cell is selected. Here is my code: import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene

Interactive Map viewer desktop application in Java

℡╲_俬逩灬. 提交于 2020-01-01 14:06:10
问题 I want to build a desktop application - a map viewer , something like this : http://sunsite.ubc.ca/UBCMap/ in Java . Whenever someone hovers the mouse over a building on the map , there should be a balloon tool-tip saying something about that building on the map like its office phone number etc and that building should glow in the 2-d map. Can someone provide me some directions as to what framework should i use in Java to build something like this(e.g JavaFx) ? Is there any sample code which

javafx snapshot without showing application or Scene

你离开我真会死。 提交于 2020-01-01 11:48:36
问题 Hi i'm using JavaFx WebView to create Screenshot of HTML pages and it works fine but i wanted to know is it possible to do this without launching the application in Graphical Windows!! I mean aren't there any more lightweight method to get the screenshot then this: public class WebViewSample extends Application { private Scene scene; @Override public void start(Stage stage) { // create scene scene = new Scene(new Browser(snapshot), 750, 500, Color.web("#666970")); stage.setScene(scene); //