javafx

Action Buttons css style in JavaFX ControlFX dialog

纵饮孤独 提交于 2019-12-29 08:01:57
问题 I've been using ControlsFX dialogs to show information, but the style of my application is not blue, and does not match dialog style (color, borders) is there a way to change the button color or styles? 回答1: Note In a more recent question, this time regarding the new Dialog API bundled with JDK8u40 early releases, I came with a less hacky and more clean solution, using stylesheets instead of inline styles and lookups. So I'm updating this question, as openjfx-dialogs is still the way to have

Action Buttons css style in JavaFX ControlFX dialog

时光毁灭记忆、已成空白 提交于 2019-12-29 08:01:29
问题 I've been using ControlsFX dialogs to show information, but the style of my application is not blue, and does not match dialog style (color, borders) is there a way to change the button color or styles? 回答1: Note In a more recent question, this time regarding the new Dialog API bundled with JDK8u40 early releases, I came with a less hacky and more clean solution, using stylesheets instead of inline styles and lookups. So I'm updating this question, as openjfx-dialogs is still the way to have

Using large txt files in JavaFX(TextArea alternatives?)

怎甘沉沦 提交于 2019-12-29 07:55:08
问题 I created a simple GUI where I have a TextArea . The TextArea itself will be populated by an Array , which contains scanned Strings out of a .txt file. This works great for smaller size files. When using large files(~5MB per txt.-file) however, the TextArea (and only the TextArea ) feels laggy and slow(not as responsive as I would like). Is there an alternative to the TextArea (doesnt have to be in JavaFX )? I'm looking for something very simple, which basically allows me to get & set text.

How to wrap a swing component in a javaFX 2.0 application

徘徊边缘 提交于 2019-12-29 07:34:29
问题 The ability to wrap a swing component in a javaFX application seems to have vanished from javaFX 2: javafx.ext.swing.SwingComponent is not there any more in javaFX 2 beta API. Is there still a way to do this in the new API? 回答1: SwingNode class is used to embed a Swing content into a JavaFX application. Here is the link. 回答2: There is 3rd-party support library, see http://rkennke.wordpress.com/2011/11/16/swing-in-javafx-demo/ 回答3: According to this issue on the FX 2.0 JIRA they aren't

javafx create ComboBox TableCell

£可爱£侵袭症+ 提交于 2019-12-29 07:31:36
问题 I'm trying to create a custom TableCell in my TableView. I'd like it to display a ComboBox where I can choose a String value, and then display the String value as if it was an user input. The idea is that ths user doesn't know which are the allowed values so he can simply pick one of them in the ComboBox. I tried to do that making my own "ComboBoxCell" but it doesn't work as expected : public class ComboBoxCell extends TableCell<ClassesProperty, String> { private ComboBox<String> comboBox;

JavaFX BarChart, Set Series Color by Series Name

谁说胖子不能爱 提交于 2019-12-29 07:18:25
问题 I am trying to dynamically set the BarChart Series color. I want to have always the same color for the same Series name. Its not always the same Series names in the chart, which is why I cannot rely on the position in the chart (colors per default always the same at the same position in the data list). chart.getData().addListener(new ListChangeListener<Series<String, Number>>() { @Override public void onChanged( final javafx.collections.ListChangeListener.Change<? extends Series<String,

JavaFX BarChart, Set Series Color by Series Name

戏子无情 提交于 2019-12-29 07:18:14
问题 I am trying to dynamically set the BarChart Series color. I want to have always the same color for the same Series name. Its not always the same Series names in the chart, which is why I cannot rely on the position in the chart (colors per default always the same at the same position in the data list). chart.getData().addListener(new ListChangeListener<Series<String, Number>>() { @Override public void onChanged( final javafx.collections.ListChangeListener.Change<? extends Series<String,

Set background image the same size as the window/screen in Java app

↘锁芯ラ 提交于 2019-12-29 07:04:12
问题 I would like to set a background image the same size as my window/screen. I would prefer to do this in my CSS file, but I have NOT FOUND a way to accomplish this. Must I do this in a javafx class file? Thanks for every help ;) 回答1: You will have to determine the screen size in java code as demonstrated in JavaFX window sizing, there is no way to determine it in CSS. For an Image, in your java code you can use something as ImageView imageView = new ImageView(image); imageView.setFitWidth

How to monitor changes on objects contained in an ObservableList JavaFX

我只是一个虾纸丫 提交于 2019-12-29 06:45:09
问题 I really have difficulties to understand how the ObservableList object is working in JavaFX. I want to monitor if an object in the List has been modified. So far, I only see that I can monitor if the List , as an entity itself, has been modified... but not the objects within the List : ObservableList<Stuff> myList = FXCollections.<Stuff>observableArrayList(); myList.add(someStuff); myList.addListener((ListChangeListener.Change<? extends Stuff> change) -> { while(change.next()){ if(change

Does the use of ObservableList in JavaFX go against Model-View-Controller separation?

折月煮酒 提交于 2019-12-29 06:44:30
问题 I am attempting a study of JavaFX because I want to use it as the GUI of my program. My question is essentially a conceptual one: To date my program is mostly the "Model" part of the MVC pattern; that is, almost all of my code is the OO-representation of abstractions in the sense of classes, and all of that code is logical code. Since I do not want to be the only user of my program, I want to add the "View" part of MVC so that people can easily use and manipulate the "Model" part of my