javafx-8

Put a image in a circle view

允我心安 提交于 2019-12-01 22:27:31
How to load any image and put it in a circle view and user with his mouse can drag the image in its circle view to his desired orientation. What control is there to do this. I tried and used a Circle filled with the imge but I cant move the image inside it nor i can select a view port in it. Any idea? Use setClip(...) to choose a "viewport". You need to implement the dragging yourself. Something like this: import javafx.application.Application; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.event.EventHandler; import javafx

How can i use a control more than one time in javafx 8?

为君一笑 提交于 2019-12-01 22:08:30
问题 I'm currently getting started with javafx 8 and came up with the following problem in a simple solution: I've different controls ( Button ), which shall appear In the main content ( center of a Pane ) In a footer ( bottom of a Pane ) Button one = new Button("1"); Button two = new Button("2"); Button three = new Button("3"); VBox vbox = new VBox(); vbox.getChildren().addAll(one, two, three); HBox hbox = new HBox(); hbox.getChildren().addAll(two, three); //To clarify my problem i leave one node

Javafx exception when clicking TreeTableCell after repopulating TreeTableView

冷暖自知 提交于 2019-12-01 20:58:20
I am currently getting an error that I do not understand. The exception that is thrown points to nothing in my code, yet it is only thrown after I repopulate a TreeTableView by clearing the root item's children and adding a new set och children to it. This is the exception: Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel.handleSelectedCellsListChangeEvent(TreeTableView.java:3056) at javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel.clearAndSelect(TreeTableView.java

Javafx slider value at mousemoved event

情到浓时终转凉″ 提交于 2019-12-01 20:47:14
I am making a media player and am trying to get the playback slider value at the cursor position when hovering over the slider bar. In an attempt to do this, i have used the following: timeSlider.addEventFilter(MouseEvent.MOUSE_MOVED, event -> System.out.println("hovering")); which prints "hovering" whenever the mouse changes position over the slider. Can anyone please show me how to get the value of the slider at the current cursor position? I can only figure out how to get the value at the thumb position. Thanks in advance. Here is a bit (maybe more than a bit) of a hack that works if you

Cell: how to activate a contextMenu by keyboard?

末鹿安然 提交于 2019-12-01 20:11:56
问题 A cell contextMenu can't be activated by keyboard: it's underlying reason being that the contextMenuEvent is dispatched to the focused node - which is the containing table, not the cell. The bug evaluation by Jonathan has an outline of how solve it: The 'proper' way to do this is to probably override the buildEventDispatchChain in TableView and include the TableViewSkin (if it implements EventDispatcher), and to keep forwarding this down to the cells in the table row. Tried to follow that

Error after running the default Gluon project (: dex FAILED)

半世苍凉 提交于 2019-12-01 19:54:09
I downloaded the Gluon plugin for Netbeans to deploy JavaFX application to Android. It ran successfully on the desktop but when I execute the android task, it throws an error: Executing: gradle :android :compileJava UP-TO-DATE :compileRetrolambdaMain UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileAndroidJava UP-TO-DATE :compileRetrolambdaAndroid SKIPPED :compileTestJava UP-TO-DATE :compileRetrolambdaTest SKIPPED :compileRetrolambda UP-TO-DATE :mergeClassesIntoJar :validateManifest :collectMultiDexComponents :shrinkMultiDexComponents :createMainDexList [ant:java] Java

Error after running the default Gluon project (: dex FAILED)

£可爱£侵袭症+ 提交于 2019-12-01 19:38:27
问题 I downloaded the Gluon plugin for Netbeans to deploy JavaFX application to Android. It ran successfully on the desktop but when I execute the android task, it throws an error: Executing: gradle :android :compileJava UP-TO-DATE :compileRetrolambdaMain UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileAndroidJava UP-TO-DATE :compileRetrolambdaAndroid SKIPPED :compileTestJava UP-TO-DATE :compileRetrolambdaTest SKIPPED :compileRetrolambda UP-TO-DATE :mergeClassesIntoJar

Cell: how to activate a contextMenu by keyboard?

前提是你 提交于 2019-12-01 19:26:24
A cell contextMenu can't be activated by keyboard : it's underlying reason being that the contextMenuEvent is dispatched to the focused node - which is the containing table, not the cell. The bug evaluation by Jonathan has an outline of how solve it: The 'proper' way to do this is to probably override the buildEventDispatchChain in TableView and include the TableViewSkin (if it implements EventDispatcher), and to keep forwarding this down to the cells in the table row. Tried to follow that path (below is an example for ListView, simply because there's only one level of skins to implement vs.

JavaFX 8 How to set program icon to alert?

守給你的承諾、 提交于 2019-12-01 18:56:05
How can I set program icon to alert without using alert.initOwner() ? Why without initOwner ? It's because some alert must be shown before whole window is initialized, so there's no scene that I can put to initOwner function. You can steal the DialogPane from an Alert instance, and add it to a regular Stage. A Node can only be the root of one Scene at a time, so you need to replace the root of the Alert’s Scene first: public class AlertWithIcon extends Application { @Override public void start(Stage stage) { Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Are you sure you want to delete

Creating a large body of text with different styles - JavaFX FXML

痴心易碎 提交于 2019-12-01 18:37:31
In the fxml class of my JavaFx application I want to add a large body of text using minimal components (instead of adding multiple labels per line). I would also like to create varying styles of text in the same component. What component should I use (e.g TextArea) and how would I go about create multiple styles inside it (using css). Use a TextFlow and add Text to it. You can style individual Text component with different style using css on them. Complete example : import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.scene.text