javafx-8

ICON set for JavaFX application is visible in Windows but not in Ubuntu

守給你的承諾、 提交于 2019-12-18 14:53:21
问题 It is a bit weird or maybe there is something wrong with my code. I am setting JavaFX application ICON which is very well visible on Windows system but not on Ubuntu. On Windows: On Ubuntu: Any idea about the reason behind this. Code Sample: @Override public void start(Stage stage) throws Exception { try { setUserAgentStylesheet(STYLESHEET_MODENA); FXMLLoader loader = new FXMLLoader(); Parent root = (Parent) loader.load(getClass().getResourceAsStream("ui/ParentWindow.fxml")); final

When to use translate and when relocate - What is the difference between translate and layout coordinates?

僤鯓⒐⒋嵵緔 提交于 2019-12-18 13:13:17
问题 When to use translate and when relocate in order to move a node? In the end of the day it seems they do the same thing (visually); move the node; the first by doing a translation on the origin (the x, y stays the same), the second by changing the x, y coords. So suppose i want to move a node in a specific point in the screen.. should i use node.relocate(x,y) or node.setTranslateX(x), node.setTranslateY(y)? To demostrate what I mean I have made a sample program you can play with: A rectangle

How can I make a TextArea stretch to fill the content, expanding the parent in the process?

核能气质少年 提交于 2019-12-18 12:58:09
问题 So I have a TextArea and as the user pastes paragraphs into it, or just writes in it, I want it to expand vertically to reveal all the available text. I.e. not to use a scrollbar in the text field itself... much like what happens on many web pages. Many users, myself included, don't like to be forced to edit in a small window. Exactly how Facebook status updates box works. I've tried myTextArea.autoSize() wrapped in an myTextArea.textProperty().addListener(new ChangeListener()....); but that

Is JavaFX 8 going to implement text field validation support?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 12:22:24
问题 JavaFX 2 does not provide validation support (masks, input filtering and so on...). It is difficult to adopt a technology that does not offer basic functionalities. I am trying to implement my own validators, but that is a big pain. Are there any news in JavaFX 8 about validation? I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8. I need to know about it, because I was considering JavaFX for a new

Combobox clearing value issue

喜欢而已 提交于 2019-12-18 12:17:37
问题 I've stumbled on an issue with Comboboxes in javafx2.2. This is the scenario: Users click on the 'editFile' button. Another pane becomes visible (with the setVisible method). This pane contains 6 comboboxes. Three of them have fixed items: cboReport, cboSales, cboSend. Three of them get their data from a db (ObservableList) and get populated when the pane becomes visible: cboFile, cboCustomer, cboVet The user selects a file number from the cboFile. The rest of the comboboxes are beeing set

GUI testing framework for JavaFX 2

馋奶兔 提交于 2019-12-18 12:07:04
问题 I'm currently reading the book Growing Object-Oriented Software Guided by Tests which gives a decent introduction into test driven development. One drawback is that the code developed through the book is based on Swing. For my next project I'd like to use Java FX 2 and I'm wondering if there are any GUI testing frameworks out there for it? The book introduces windowlicker, which allows testing Swing applications only. 回答1: There is a library named JemmyFX. Jemmy itself is a set of libraries

MenuButton doesn't display items in Javafx

痴心易碎 提交于 2019-12-18 09:07:02
问题 I have a class Foo which just load the FXML and create the scene. In the FXML, I set the controller to be FooController ( fx:controller="FooController" ) And I add a MenuButton: <MenuButton fx:id="menuButton" layoutX="264.1875" layoutY="146.5" mnemonicParsing="false" text="MenuButton" /> And I try to set the menuButton in the FooController: public class FooController implements Initializable{ @FXML final MenuButton menuButton = new MenuButton("Modalities"); @Override public void initialize

Progress Bars update crash javaFX

倖福魔咒の 提交于 2019-12-18 09:03:43
问题 I have a pretty nasty bug on JavaFX (jdk 1.8.0_91) occurring in my application in which several progress bars are displayed and update (randomly or at the same time). Sometimes, especially when a progress bar is filled (it had a style class to the progress bar) but sometimes also in the middle of nothing, the software blocks and I have this trace appearing several times (not always the same number, but the last one was 27 times) : Exception in thread "JavaFX Application Thread" java.lang

Programmatically edit TreeView/TreeItem

我是研究僧i 提交于 2019-12-18 09:02:09
问题 Edit #2 : Since it looks like a bug i already posted a bug report in the javaFx-jira. You have to have an account to have access to the issue. I will keep this post up-to-date, if there is new information. Original post: I have a simple UI with a button and a TreeView. If the button gets pressed there should be a new item added to the TreeView. This item should be editable as soon as it appears in the tree. import javafx.fxml.FXML; import javafx.scene.control.TreeItem; import javafx.scene

Can't get mouse event from any other javafx 8 node after getting MOUSE_PRESSED event from one node

拥有回忆 提交于 2019-12-18 09:00:57
问题 I'm creating rich text component with selection capabilities for JavaFX project and facing some difficulties. I'm trying to catch on which TextFlow object user presses mouse button and on which another TextFlow he releases it. But after MOUSE_PRESSED event i can interact only with that TextFlow, who fired it, until i release the mouse. Here is similar example with Labels: package sample; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label;