javafx-8

JavaFX scrolling table update performance degrades over time

落花浮王杯 提交于 2019-12-10 12:32:14
问题 I have a TableView that shows last N items, new items at top, remove items from the bottom etc... What appears to be happening is CPU load increases over time to point where other X applications on same machine become sluggish. Platform details: Redhat 6.7, 32 bit, Java 1.8u40 Things I've tried Introduced runLater() - original code updated the observable list from a non-FX thread - apparently this is wrong Optimize - only place new Runnables on JavaFX application thread if there isn't already

Combobox with Progress bars is not working properly

只愿长相守 提交于 2019-12-10 12:23:27
问题 I have this example of a combobox with progress bars. package javafxapplication4; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.ProgressBar; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; import javafx.util.Callback;

Code is working in jdk7 not in jdk8

落爺英雄遲暮 提交于 2019-12-10 12:19:33
问题 I took the sample code from How to create custom components in JavaFX 2.0 using FXML?. the code working fine in jdk7 but the checkbox and combo box values are not working in jdk8. I am not able to click the check box even and select the dropdown. Please guide me for the same. Please find the sample code below Package structure com.example.javafx.choice ChoiceCell.java ChoiceController.java ChoiceModel.java ChoiceView.fxml com.example.javafx.mvc FxmlMvcPatternDemo.java MainController.java

javafx-TableView as combobox popup (Tried and able to achieve partially. need help further)

一曲冷凌霜 提交于 2019-12-10 11:30:05
问题 What i need: Need an editable combobox which filters the data on the popup upon typing and first matching item should be highlighted and should set as the text in the combo upon pressing enter. The popup should be a tableview with 2 or 3 columns. (screen shot attached.)(in the image it is a textfield but i prefer combo so that if the user is not sure about the values, he can click the combo button and see the entire list and select one.) I will be binding some data as a source to the

How to show Image as tooltip in JavaFX?

不想你离开。 提交于 2019-12-10 11:09:13
问题 I would like to show an image as a tooltip. It works OK but at some random points it shows fluctuation. I want to show it normally without getting fluctuate. I show a new scene (in which i added my image-view with image) on mouse enter event and close it on mouse leave event event // MOUSE ENTER PHOTO CORRECTIO @FXML private void mouseEnterPhotoCorrection(MouseEvent event) { if (f_ShowToolTip) { Stage stg = funShowImageTooltip(); double x, y; x = event.getScreenX(); y = event.getScreenY();

How to detect MouseClick on the “stroke” part of a QuadCurve?

女生的网名这么多〃 提交于 2019-12-10 11:06:07
问题 I want to detect mouse click event on a QuadCurve but only on the "stroke" part. To be clear only the green part of the image. Here, i use a red fill value but in my application i use a transparent fill value. So detecting click on the visible part of the curve is critical. The sample code : import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.scene.shape.QuadCurve;

How to pass variable from controller code to fxml view?

大憨熊 提交于 2019-12-10 10:47:03
问题 I have custom component with few labels and few textFields. I need to instantiate it 3 times, but each version must have all labels prefixed with different String. Fragment of my component fxml: <Label text="inclusions type:"/> <Label text="inclusions size:" GridPane.rowIndex="1"/> <Label text="inclusions number:" GridPane.rowIndex="2"/> I would like to achieve some kind of code placeholder like: <Label text="$variable inclusions type:"/> <Label text="$variable size:" GridPane.rowIndex="1"/>

Styling button in javaFX using CSS

僤鯓⒐⒋嵵緔 提交于 2019-12-10 10:44:05
问题 I have a problem with styling button in javaFX using CSS. I use Intellij Idea IDE. I have CSS.css file : #Button { -fx-padding: 8 15 15 15; -fx-background-insets: 0,0 0 5 0, 0 0 6 0, 0 0 7 0; -fx-background-radius: 8; -fx-background-color: linear-gradient(from 0% 93% to 0% 100%, #a34313 0%, #903b12 100%), #9d4024, #d86e3a, radial-gradient(center 50% 50%, radius 100%, #d86e3a, #c54e2c); -fx-effect: dropshadow( gaussian , rgba(0,0,0,0.75) , 4,0,0,1 ); -fx-font-weight: bold; -fx-font-size: 1.1em

How to detect location and size of tab header in JavaFX

时光毁灭记忆、已成空白 提交于 2019-12-10 10:40:05
问题 I am still new to javaFX. In my code I need to get location and size of tab header, but I can't find any property or function which return its size or location. 回答1: I don't understand your question properly, but generally you can use the lookup function to get the .tab-header-area CSS selector which is actually a StackPane . TabPane tabPane = new TabPane(); tabPane.getTabs().addAll(new Tab("Tab1"), new Tab("Tab2"), new Tab("Tab3")); Button b = new Button("Get header"); b.setOnAction((e) -> {

Using JavaFX with drag and drop, is it possible to have a ghost of the dragged object follow the cursor?

喜欢而已 提交于 2019-12-10 10:34:49
问题 I have been looking for examples of Drag and Drop with Java but they always use a generic mouse cursor with a box attached to indicate an item is being dragged, whereas many tools (even browsers like Firefox) instead attach a ghost of the dragged object to the cursor to indicate what is being dragged. Can this be done in JavaFX? 回答1: Yes you can set a drag view (arbitrary image) for a drag and drop operation. 回答2: You can use DragBoard.setDragView(...); to set an image that is displayed