javafx

JavaFX TreeTableView - Prevent selection of certain TreeItems

不问归期 提交于 2020-01-26 04:06:06
问题 I have looked at a couple of questions here, but I can't seem to find anything related to disabling selection of rows for TreeTableViews in particular in JavaFX. The closest related questions I have come across are all related to TreeViews: How to make certain JavaFX TreeView nodes non-selectable? TreeView - Certain TreeItems are not allowed to be selected The answer given in question 2 where a custom selection-model is used that extends from MultipleSelectionModel seems to be the most

I am trying to understand gridpane and how to use it with combobox, and VBox/HBox

北战南征 提交于 2020-01-26 03:59:07
问题 I have a more simpler program that just shows the name and the address. I am playing around with place in the gridpane to put these things. Eventually, I would like a combobox , and a clockAnimation in the gridpane. I really don't know how to use HBox/VBox within gridpane, and if I can use them and label and text together. What I am trying to do is put a combo box in the middle of the gridpane, and a clock on the right. I would like to use the the gridpane, and HBox and VBox. I just don't

JavaFX Stage resizing - Strange behaviour

亡梦爱人 提交于 2020-01-26 00:55:53
问题 Consider the following JavaFx code running on JDK8: /*Imports*/ public class StageResizing extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage){ stage.setScene(new Scene(new BorderPane(new Text("Text here.")), 200, 200)); stage.widthProperty().addListener((ObservableValue<? extends Number> ov, Number t, Number t1) -> { stage.setHeight(t1.doubleValue()); }); stage.heightProperty().addListener((ObservableValue<? extends Number>

Display webview with basic authentication inside program

旧巷老猫 提交于 2020-01-25 23:53:26
问题 I have to display a webpage inside my Java software.( you can think it is one the page of a Wireless Device configuration) But when Im gonna go to that page in browser,browser displays a user and password popup and I enter the user and password and go to that page.( notice that username is always root, but password can be different) Now I am gonna display the page from Java software, I could link the page and open the page via Java , But the host inside the wireless device displays : 401

javafx: Custom TableColumn

陌路散爱 提交于 2020-01-25 21:32:31
问题 I want to make a custom TableColumn that when in editable state it's cells will be auto complete TextField s, here is what I tried: public static <T,S> void setAutoCompleteTableColumn(TableColumn<T,S> column, List items){ column.setCellFactory(param -> { return new TableCell<T, S>(){ final TextField textField = new TextField(); @Override protected void updateItem(S item, boolean empty) { super.updateItem(item, empty); if(item == null){ setGraphic(null); }else { setGraphic(textField);

javafx: Custom TableColumn

为君一笑 提交于 2020-01-25 21:32:07
问题 I want to make a custom TableColumn that when in editable state it's cells will be auto complete TextField s, here is what I tried: public static <T,S> void setAutoCompleteTableColumn(TableColumn<T,S> column, List items){ column.setCellFactory(param -> { return new TableCell<T, S>(){ final TextField textField = new TextField(); @Override protected void updateItem(S item, boolean empty) { super.updateItem(item, empty); if(item == null){ setGraphic(null); }else { setGraphic(textField);

How do I use a Map as a TableView ObservableMap object parameter?

我怕爱的太早我们不能终老 提交于 2020-01-25 17:37:51
问题 I am currently developing an application that, internally, has an HashMap that stores created Tasks associated to a string, declared like this: private Map<String, Task> _tabs = new HashMap<String,Task>(); It works fine in the terminal but currently I am developing a javafx GUI to said application and, at first, I thought I needed a ListView object to list the tasks and I did as follows: @FXML private ListView<Task> lstView = new ListView<Task>(); @FXML private CheckBox verified; @FXML

JavaFx: How to keep the window maximizing?

十年热恋 提交于 2020-01-25 12:49:25
问题 My app, if I click the "maximize button", it will maximize the window. But if I go to another scene(in the same stage), the window will restore to the original size. So, how can I control it to keep maximizing? 回答1: I used primaryStage.setMaximized(true); after calling show(); method in Java 8 implementation. It keeps other scenes maximizing. 回答2: I had the same problem. I fixed it creating a root stage with that only contains a menu bar and a tool bar, like this: I initialized this window in

JavaFX ContextMenu max size has no effect

拟墨画扇 提交于 2020-01-25 11:21:32
问题 If a ContextMenu has lots of items, it fills the entire screen. It seems that ContextMenu.setMaxSize has no effect whatsoever. Is there a way to restrict the size of a ContextMenu , in a way that it is still scrollable via mouse wheel & and the up and down buttons appear? I guess I could roll my own control with VBox & Scrollpane, but I'd like to avoid this if possible. 回答1: Unfortunately, limiting the size of popup is not supported: the Region that's responsible for showing the MenuItems is

“Could not find or load main class” while trying to use JavaFX in Eclipse

南楼画角 提交于 2020-01-25 08:22:20
问题 java version 1.8.0_221 eclipse version 2019-06 (4.12.0) I'm trying to make a basic JavaFX program. I've imported jfxrt external jar into the libraries tab under module build path. I've been getting this error "Error: Could not find or load main class firstFX.eighthTry Caused by: java.lang.NoClassDefFoundError: javafx/application/Application" The only advice I've found around the web tells me to get rid of any external jars, but I need jfxswt in order to use JavaFX. I've also tried to use