javafx-8

Adding values to selected javafx ComboBoxTableCell dynamically

落花浮王杯 提交于 2019-12-01 11:38:44
I have a TableView with two columns named Product and Brand. A Product can be of different Brands. Eg. TV has different brands like Samsung, Sony etc. I am showing Brands of a Product in ComboBoxes. This is how i am adding a ComboBoxTableCell for my Brand Column. ObservableList<String> catList = FXCollections.observableArrayList(); categoryCol.setCellFactory(t -> { ComboBoxTableCell comboCell = new ComboBoxTableCell(catList); return comboCell; }); contactTable.getColumns().add(categoryCol); Now in these ComboBoxes i want to add values of Brands. Since There will be different Products so their

JavaFX - Detect & highlight TableColumn being dragged onto

倾然丶 夕夏残阳落幕 提交于 2019-12-01 11:13:21
问题 What's the best way to discover which TableColumn (in a TableView) that a DragEvent occurred? I'd like to be able to highlight (ex. change the background color to yellow, or show a yellow border around the column) a TableColumn as a dragged item is "hovering" over the it, to make it clear to the user which column they're dropping onto. After the drag is finished of course I'll have to make sure the TableView's style is restored. To be clear, the exact cell being dropped onto doesn't matter -

Skinning custom 3D cube in javafx 8

折月煮酒 提交于 2019-12-01 11:10:40
问题 I am trying to add a skin to a cube by using the following code, but the skin will not work at all. I tested to see if it will add to a default cube and it will (but repeats the full image on each side instead of wrapping around it, which is why I am making a custom cube to prevent this). Any help would be greatly appreciated. private void buildGraphics() { Image dieImage = new Image(getClass().getResourceAsStream("images/die.gif")); PhongMaterial material = new PhongMaterial(); material

create a polyline in gluon mapLayer

拥有回忆 提交于 2019-12-01 11:03:01
Google maps API makes it possible to create a layer on the map containing a polyline linking points together. I have searched where I could to find an example or an implementation for this for gluon's mapLayer. Please advice While there's no explicit API for drawing lines, polylines or polygons on top of a MapView , the MapLayer is a layer where you can draw any JavaFX Shape , providing you take care of scaling it to the map coordinates. For that, if you have a look at the PoiLayer class , you can see that for any MapPoint (defined by latitude and longitude) you can get a 2D point (defined by

JavaFx: How to compare values of dynamically created TextFields inside GridPane?

孤人 提交于 2019-12-01 10:41:23
I'm developing an application using JavaFx in which I'm creating dynamic TextFields inside a GridPane and there is a Button which is initially disabled like this: So what I want is if Column 1 TextFields values are less than Column 3 TextFields values, button should be enable like this: But let say if any of Column 3 TextField value become less than Column 1 TextField value of same row, it should disable button and show that specific TextField border in red color and when hover mouse over that field should display some warning: I'm creating TextField like this: public static GridPane table(int

Javafx adding Image in TableView

最后都变了- 提交于 2019-12-01 09:58:12
I am trying to add image in tableView but I can't add image. I am getting image in byte[] and I can set this image in imageView but is there any way to add it in tableView ? person3 class: public class person3 { private final StringProperty firstName7 = new SimpleStringProperty(""); private final StringProperty firstName8 = new SimpleStringProperty(""); public person3(String firstName4, String firstName5) { setFirstName7(firstName4); setFirstName8(firstName5); } public String getFirstName7() { return firstName7.get(); } public void setFirstName7(String name) { this.firstName7.set(name); }

How to resize component with mouse drag in JavaFX

我只是一个虾纸丫 提交于 2019-12-01 09:16:22
I'm interested how I can resize this component with mouse drag: VBox stackedTitledPanes = createStackedTitledPanes(); ScrollPane scroll = makeScrollable(stackedTitledPanes); TabPane tabPane = new TabPane(); BorderPane mainPane = new BorderPane(); tabPane.setStyle("-fx-font-size: 12pt;"); // Set global size for the font // Create Tabs Tab tabA = new Tab(); tabA.setText("Main Component"); tabA.setStyle("-fx-font-size: 12pt;"); // Set size of the tab name // Add something in Tab StackPane tabA_stack = new StackPane(); tabA_stack.setAlignment(Pos.CENTER); tabA_stack.getChildren().add(scroll); tabA

Dragging and dropping list view items between different javafx windows

删除回忆录丶 提交于 2019-12-01 09:04:06
I've been wondering how you would be able to drag and drop list view items between 2 java fx windows. The code that I used was tilePane.setOnDragDropped((event) -> { Dragboard db = event.getDragboard(); boolean success = false; if (db.hasString()) { TilePane pane = (TilePane) event.getGestureTarget(); if (pane.getChildren().size() >= 10) { //error } else { ListView<Item> list = (ListView<Item>) event .getGestureSource(); addShopItem(pane, list.getSelectionModel() .getSelectedItem()); success = true; } } event.setDropCompleted(success); event.consume(); }); Both the list view and tile pane used

Create wizard in JavaFX

﹥>﹥吖頭↗ 提交于 2019-12-01 08:44:22
Is there any example how to create wizard in JavaFX? For example to setup a program or for configuration. Can this be done with simple code or I need to create custom component? Here is code for a sample wizard in JavaFX . This code was a JavaFX 2.x conversion of a SWT based solution for java2s . You could modify this code to use ControlsFX dialogs to get a more professional look to the wizard. import javafx.application.Application; import javafx.beans.property.*; import javafx.beans.value.*; import javafx.collections.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene

Building JavaFX UI dynamically on the fly

跟風遠走 提交于 2019-12-01 08:43:53
问题 I am a novice to JavaFX. Still fiddling around a few samples to try and decide if that works out for the application that we are trying to build. First phase of our app is kind of a data entry phase where the users will be poised with a lot of questions and his responses are recorded. The catch here is that another team is building the question set and these questions are in an XML, like this. <?xml version="1.0" encoding="UTF-8"?> <userData> <question id="Q1" type ="desc"> <text>Enter the