javafx-2

Executable Jar limited to one window with JavaFX

白昼怎懂夜的黑 提交于 2019-12-22 12:17:29
问题 I am building a JavaFX application through E(fx)clipse and Java Scene Builder . The basic functionality is a login window. Once logged in, new window opens and the login window disapears. Right now it's just at the prototype stage. When running out of ecplise, the functionality I want is all there. Login window shows up on start (code looking as such) @Override public void start(Stage primaryStage) { try { Parent root = FXMLLoader.load(getClass().getResource("view/login.fxml"), ResourceBundle

Need clarification of what is this Public API in JavaFX?

白昼怎懂夜的黑 提交于 2019-12-22 11:20:25
问题 I heart a lot about the term Public API from JavaFX speakers. What is Public API supposed to mean ? Conversely, is there a Private API ? 回答1: The most important things, you should understand about private and public API: At first, technicly, you can use both of them. At the second. when developers develop some programs, they think - this is for users, and this is our implementation. And when time goes, programs can change. And when developers add changes - if it is a change about private API

What is replacement of alert in javafx 2.1 ? Alert is in javafx 1.3 but not in javafx 2.1

南楼画角 提交于 2019-12-22 10:23:26
问题 Alert is class in javafx 1.3 but in javafx 2.1, is not. So what is replacement of alert in javafx 2.1 ? 回答1: Teocali is correct. Alert dialogs go into the platform in 3.0, which is currently under development. JavaFX 2.2 features support for dialogs which suspend execution when they are displayed. This makes creating your own alert implementation (by calling stage.showAndWait() ) pretty trivial. (to access the JavaFX jira links in this answer, you can sign up for a jira account upon clicking

what is the difference between stackpane and root in javafx?

ぐ巨炮叔叔 提交于 2019-12-22 09:38:37
问题 I was practicing for javafx for doing pie chart. Following are the codes for developing pie chart. If i do with the Group and with the StackPane ,I find no difference in the output.I have commented the Group part.Just wandering the difference between the two. import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.chart.PieChart; import javafx.scene.chart

JavaFX HMTLEditor doesn't react on 'return' key

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:30:01
问题 I was trying to do some experiments with JavaFX' HTMLEditor component. I used the following code(excerpt): fxPanel=new JFXPanel(); Platform.runLater(new Runnable() { @Override public void run() { Group group = new Group(); scene = new Scene(group); fxPanel.setScene(scene); view = VBoxBuilder.create().build(); group.getChildren().add(view); edit = HTMLEditorBuilder.create().build(); // toolPane = TabPaneBuilder.create().minHeight(60d).build(); //toolPane.getTabs().add(new Tab("Allgemein"));

expand TreeView (parent)nodes which contains selected item

心已入冬 提交于 2019-12-22 09:15:35
问题 I have a TreeView existing out of User objects. The TreeView represents the hierarchy of the Users: Master1 Super1 Super2 User1 User2 Super3 User3 Super4 Master2 ... Every TreeItem is Collapsed when the TreeView is initialized. However, it can be that when the FXML is loaded, a TreeItem object is passed through from another FXML file. Eg: User3 has been passed through: selectedUserTreeItem = (TreeItem<User>) currentNavigation.getPassthroughObject(); //this is the User3 TreeItem I try to use a

Binding JavaFX 2 TableView elements

独自空忆成欢 提交于 2019-12-22 09:08:30
问题 I was working on a small application using a simple binding in JavaFx 2.1 using java 1.7.0_04-b21 on MacOSX. Actually I currently compare the bind mechanisms of Cocoa on Mac OSX to the JavaFx and face several problems: The application uses a model holding an observableArrayList (called messageList) which is set as the items of a TableView. Adding a new Entry to the list works. The entry appears in the TableView. Issue 1: Deleting a selected item does not work. When I remove an item from the

JavaFX update textArea

痴心易碎 提交于 2019-12-22 08:23:11
问题 I have a simple JavaFX application which has a TextArea. I can update the content of the textArea with the code below inside the start() method: new Thread(new Runnable() { public void run() { for (int i = 0; i < 2000; i++) { Platform.runLater(new Runnable() { public void run() { txtarea.appendText("text\n"); } }); } } }).start(); The code just write the text string into the TextArea 2000 times. I want to update this textArea from a function which is implemented outside of the start() method.

Unit testing JavaFx 2 application with TestNG

删除回忆录丶 提交于 2019-12-22 08:07:52
问题 I wrote a rather complex JavaFx 2 application for which I'd like to write a bunch of unit tests. Problem is when I try to conduct the tests I get a runtime error complaining about uninitialized toolkit. From what I can tell I should somehow invoke Application.launch() in a @BeforeClass method but this causes a deadlock as Application.launch() doesn't return to calling thread. So question is how should I initialize JavaFx? This is the skeleton of the code that doesn't work: public class

Restart an Application in JavaFx

主宰稳场 提交于 2019-12-22 06:44:58
问题 I want to close and then restart a already running application (automatically) that I am making, by clicking a button or something like that, I want to do that for the purpose of re-launching the application in an other language, I'm new to JavaFx and Java in general, please can you give me a solution for this problem ? 回答1: This question lacks details. You did mention a JavaFX application but it is important to know how that application is being deployed. Is it running in the web browser, as