javafx

Printing A JavaFX WebView

ぃ、小莉子 提交于 2020-01-04 07:46:21
问题 I've looked around but can't find any tutorials as to how to go about Printing a JavaFX 2.0 WebView. Anyone with real world experience for this problem? 回答1: It should be fairly easy to use the following approach: Capture the WebView as an image Print the image using any of Java's standard printing services. This blog post links to some useful details on how to do this. 来源: https://stackoverflow.com/questions/9280656/printing-a-javafx-webview

Answered - JavaFX: SubScene won't focus inside TabPane when clicked? [closed]

馋奶兔 提交于 2020-01-04 06:40:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . [ Issue ] : Seems like the behavior of SubScene or TabPane isn't what i was expecting or something is wrong with it. Because Instead of Being Focused on Subscene [*1.] when i click on Subscene it focuses on TabPane . Even when i force it to focus on the SubScene it forces back & focuses on TabPane [*2.] (Is in

How to make JavaFX Property Listener to fire an event even if the oldVaule and newValue are the same?

十年热恋 提交于 2020-01-04 06:32:53
问题 Lets consider a sample code: SimpleIntegerProperty simpleIntegerProperty = new SimpleIntegerProperty(0); simpleIntegerProperty.addListener((observable, oldValue, newValue) -> { // execution code when the event is fired. }); When I set a new value using a setValue() method, if the oldValue and newValue are the same, the event is not fired. Only when they differ. An example: I have a ListView<Element> binded with an ObservableList<Element> containing some "elements". I can add more elements in

Creating image variable not working

醉酒当歌 提交于 2020-01-04 06:31:30
问题 So I write the following code in eclipse: package myProgram; import com.sun.glass.ui.Screen; import com.sun.prism.paint.Color; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.geometry.Rectangle2D; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane

registering changelistener to group of nodes in javafx

孤者浪人 提交于 2020-01-04 06:25:15
问题 Is there any way to add a changelistener to group of nodes for following changes? For example, we can add a changelistener to a tabpane for getting tabselectedproperty. I want to add changelistener a to a group of buttons for getting buttonActionedProperty! I want to get old button and new button.... Is there any way to do this? 回答1: When you compare the tabs in a tab pane to a collection of buttons, you're not really comparing like to like. A tab pane naturally has a sense of which tab is

FXML Doccument refusing to import other fxml files

梦想与她 提交于 2020-01-04 04:23:32
问题 I have a main FXML document for my program which contains a TabPane . For each tab I want it to have its own controller and fxml file. When I try to include the external fmxl files into the main fxml document, my program refuses to run. here is my main FXML document: here is a copy of my java file @Override public void start(Stage stage) throws Exception { FXMLLoader fxml = new FXMLLoader(); Parent root = fxml.load(getClass().getResource("FXMLDocument.fxml").openStream()); Scene scene = new

JavaFX TitledPane lookup(.title) returns null

冷暖自知 提交于 2020-01-04 04:14:07
问题 I'm new to Java FX and am creating an application for fun. I'm trying to add a TitledPane dynamically and am getting Null Pointer Exceptions when attempting to lookup the title of the TitledPane about 70% of the time. I tried to create a simple demo of my issue, but was unable to reproduce the issue outside of my application, but I could solve my issue. I'm hoping someone could help me understand why my solution works and maybe point me in the direction of a better solution. I'm using an FXML

Javafx error on Ubuntu while using netbeans

心不动则不痛 提交于 2020-01-04 04:04:10
问题 When trying to run a basic javafx application on ubuntu linux, I am seeing the following error. The error appears while using either the commandline or netbeans to run the application. Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: /home/venkat/.m2/repository/com/oracle/javafx/javafx/2.1.0-beta/i386/libglass.so at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:277) at com.sun.javafx.application.PlatformImpl

How to make certain JavaFX TreeView nodes non-selectable?

佐手、 提交于 2020-01-04 03:56:06
问题 I would like to make the 'folder' nodes in my JavaFX TreeView expandable and collapsible but not selectable . I found this discussion and looked into EventFilter , but there does not appear to be any EventType that corresponds with TreeView selection changes. The second suggestion, a custom selection model, sounds like a deep dive to me. So, am I stuck allowing the selection events to trigger my listener and then sort through the trash there? 回答1: It's a bit hacky, but I ended up doing it

JavaFx: In TreeView Need Only Scroll to Index number when treeitem is out of View

北慕城南 提交于 2020-01-04 03:51:08
问题 I need to do a simple thing. I have a large TreeView. and a menu item Next and Previous. on Next I have to select next Tree Item. Tree List Look like this -Root(set visible hide is true for root) --Parent 1 ----Child 1 ----Child 2 ----Child 3 --Parent 2 ----Child 1 ----Child 2 Now By pressing Next or previous menu item i call myTreeView.getSelectionModel().clearAndSelect(newIndex); By This I have manage to select next item and by myTreeView.getSelectionModel().scrollTo(newIndex) i have manage