javafx-8

JavaFX - Outlook attachments - DnD

核能气质少年 提交于 2019-12-24 00:39:19
问题 Hello i need a DnD Solution to Drag Outlook Mail Attachments to a Stackpane. JavaFX / Outlook 2010 stackpaneDragAndDropZone.setOnDragOver((DragEvent event) -> { Dragboard db = event.getDragboard(); System.out.println(db.getContentTypes()); }); Has this Output: [[message/external-body;access-type=clipboard;index=0;name="faxdoc-150217-1300-+49-206581978.pdf"], [RenPrivateItem]] How can i use this RenPrivateItem? On regular Java i got a file with this code: dropTarget.addDropTargetListener(new

Replace Text with number in TextField

和自甴很熟 提交于 2019-12-24 00:12:15
问题 I have this field in which I insert port number. I would like to convert the string automatically into number: fieldNport = new TextField(); fieldNport.setPrefSize(180, 24); fieldNport.setFont(Font.font("Tahoma", 11)); grid.add(fieldNport, 1, 1); Can you tell how I can do this? I cannot find suitable example in stack overflow. EDIT: Maybe this: fieldNport.textProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue o, Object oldVal, Object newVal) { try {

javafx jar builds fine but doesn't open

南楼画角 提交于 2019-12-23 21:14:16
问题 So i created a javafx project, it has 3 packages, application, controller, and an images package that holds all the images im using. The program runs fine if i just compile and run, no errors. However, when i create a jar from it, by selecting the build.fxbuild, everything goes smoothly and it tells me it is successful but when i try to double click the jar file nothing opens but java starts running in the background until i force close it. Im running OSX yosemite, and im on java 1.8 if that

Combine multiple jar into one (using maven)

孤者浪人 提交于 2019-12-23 19:44:55
问题 I have a project in javafx , I have 3 dependencies I try to combine them with my principale jar using maven : The result I got a jar (1.82mb) but when I click he dosen't launch noting appears. pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <dependencies>

How to get selected TableCell in JavaFX TableView

此生再无相见时 提交于 2019-12-23 17:54:35
问题 I am looking for a way to get the selected cell of a TableView control. Note that I don't just want the cell value, I want an actual TableCell object. One would expect that the method: tableView.getSelectionModel().getSelectedCells().get(0) does just that, but it returns a TablePosition object, which gives you row and column information, but I don't see a way to get TableCell object from that. The reason I need this is because I want to respond to a key press, but attaching an event filter to

Apply gradient to sphere object with JavaFX

泪湿孤枕 提交于 2019-12-23 17:00:50
问题 I'm working in JavaFX for a class, and I'm trying to apply a gradient to a sphere, but (obviously), I can't figure out how to do it. I'm stuck because I know that a sphere is an object, and so it needs to have a material, but (as far as colors go), a PhongMaterial only takes one color, and so it won't take a gradient because a gradient is a range of colors. So basically what I'm trying to is the following: Sphere sphere = new Sphere(50); RadialGradient rg = new RadialGradient(0, 0, 0, 0, 5,

JavaFX TreeTableView rows gone when scrolling

[亡魂溺海] 提交于 2019-12-23 16:11:30
问题 I have been experimenting with the TreeTableView in JDK 8 . After getting my program up and functioning, I noticed a problem that when I scrolled, rows would be getting blanked out. I have tried everything from resetting the visibility of the cell, when it updates, in hopes that it would redraw when it gets updated, or even resetting the visibility of the column. Here is a test applet I wrote to show that when you scroll for a tree table view, the rows get blanked out, but for a table view,

Get visible state of Node in JavaFX 8

两盒软妹~` 提交于 2019-12-23 15:16:05
问题 I need to detect if a node is currently displaying. I.e. if my Node is in a TabPane, I need to know if it is in a selected tab or not. In the example, I want to know when the HBox is displaying.The visibleProperty and managedProperty of Node, does not seem to help me: public class VisibleTest extends Application { @Override public void start(Stage primaryStage) throws Exception { TabPane tabpane = new TabPane(); tabpane.getTabs().add(new Tab("Tab1", new Label("Label1"))); HBox hbox = new HBox

How to know if a scroll bar is visible on a JavaFx TableView

╄→гoц情女王★ 提交于 2019-12-23 12:33:57
问题 Is there a way to know if a scroll bar is present on a table view? (Other than what I did in my code below) My goal is to position 2 arrow images (to close/open a side panel) on the right side of a table (over the table.). But I don't want to put them over the scroll bar. The table content is a result of a search, so sometime the scroll bar is visible and other time it is not. If there is not enough items. I want the position of my arrows to change every time the tableview items change. I

How to automatically resize dialog pane when content is added?

為{幸葍}努か 提交于 2019-12-23 11:53:02
问题 For an application I am developing, I need the user to input a number of rows of data. The exact number is variable and the users should be able to add rows themselves too. I've got this all working now with a JavaFX Dialog, apart from the fact that when you add rows, the Dialog is not resized accordingly. Is there a way to get the Dialog to resize automatically when a row is added? Below is a demo application with a sample test application with a Dialog similar to what I want. package test