javafx-2

Java FX 2 Table Cell Editing and Focus

做~自己de王妃 提交于 2020-01-03 09:07:12
问题 I've been learning a bit about JavaFX 2 but I've hit a problem with editable table cells that I can't find a solution too. To save pasting in a lot of code I've created a project that contains only the TableView example from the JavaFX documentation: http://docs.oracle.com/javafx/2/ui_controls/table-view.htm If you run up this code you see this behaviour: Clicking a row selects that row. Clicking a cell in the selected row converts the cell to a text field so that it is ready to be edited.

How to scale and set coordinates of MediaView?

我们两清 提交于 2020-01-02 20:02:15
问题 I would like to embedd a video in my JavaFx 2.x scene and also resize it and relocate it to my needs. The problem I'm having is following. If I build a MediaView component and then translate X or Y coordinate, then the whole view is being properly moved like so: MediaView mv = (...) mv.setTranslateX(200); mv.setTranslateY(200); I could do a similar transformation with scaling property: MediaView mv = (...) mv.setScaleX(2); mv.setScaleY(2); which will properly scale mv instance two times in

How to scale and set coordinates of MediaView?

左心房为你撑大大i 提交于 2020-01-02 20:01:27
问题 I would like to embedd a video in my JavaFx 2.x scene and also resize it and relocate it to my needs. The problem I'm having is following. If I build a MediaView component and then translate X or Y coordinate, then the whole view is being properly moved like so: MediaView mv = (...) mv.setTranslateX(200); mv.setTranslateY(200); I could do a similar transformation with scaling property: MediaView mv = (...) mv.setScaleX(2); mv.setScaleY(2); which will properly scale mv instance two times in

Logger entries translated to the UI stops being updated with time

Deadly 提交于 2020-01-02 18:05:46
问题 I have a javafx.concurrent.Task that run some code in background and use the java.util.logging.Logger to give information about its status. I need to show this log entry in the UI in the main thread. how can I do this? this is a simple toy project I've made to solve the problem out of the context @Override public void start(Stage primaryStage) { ListView<String> list = new ListView<>(); final ObservableList<String> items =FXCollections.observableArrayList (); list.setItems(items); Task<String

Form validator message

拜拜、爱过 提交于 2020-01-02 06:56:21
问题 I'm looking for form validator similar to these examples: or Is this custom JavaFX component or this can be done using standard JavaFX? Is there any example how I can create form validator similar to these? 回答1: Just to give you a kick start, here is a small example with using ContextMenu. May be ContextMenu is not an ideal Control for this scenario and you are free to replace it with Label, Text etc. Keep the TextField and Label inside a HBox (with Label being hidden initially) and the HBox

Is it possible to enable hardware acceleration with Java FX on Windows 2008 server?

别说谁变了你拦得住时间么 提交于 2020-01-02 04:39:05
问题 As discussed in this question, it's possible to detect whether Java FX is using hardware acceleration by passing -Dprism.verbose=true as a system property. When I do this on my Java FX app on Windows 2008 Server R2, it is apparently falling back to the software rendering: Prism pipeline init order: d3d j2d Using t2k for text rasterization Using dirty region optimizations Prism pipeline name = com.sun.prism.d3d.D3DPipeline Loading D3D native library ... succeeded. Direct3D initialization

How to make JNLP download the correct version of JavaFX 2?

余生颓废 提交于 2020-01-02 04:00:08
问题 JavaFX 2 is highly dependent on native code. For my desktop application, I would like to select the best-matching JavaFX flavor for each supported OS to make the installation on the target systems as painless as possible. Since JavaFX 2 comes with several Ant tasks to help with deployment, I thought this was the way to go, but I seem to have hit a dead end. The deploy task generates a JNLP file which includes a resource reference that calls the JavaFX installer: <resources> <jfx:javafx

How to change the text font size in javafx?

梦想与她 提交于 2020-01-02 03:24:11
问题 I am making a project in javafx. As part of it I created a warning box. Its text font size is too small. The code of the warning box is : Stage dialogStage = new Stage(); dialogStage.initStyle(StageStyle.UTILITY); dialogStage.setScene(new Scene(VBoxBuilder.create(). children(new Text("Username or Password Error...!\n" + "Please Enter Correct Details...")). alignment(Pos.CENTER).padding(new Insets(15,15,15,15)).build())); dialogStage.show(); How can I change or increase the text font size ?

How to listen for WindowEvent.WINDOW_SHOWN in the nodes of the scene graph?

你说的曾经没有我的故事 提交于 2020-01-02 02:26:30
问题 It seems WindowEvent.WINDOW_SHOWN never gets dispatched on any of the nodes in the scene graph, nor is there anyway (that I could find) to know when a node is visible/rendered/shown. For example: TestLauncher.java package com.example.javafx.event; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class TestLauncher extends Application { public static void main(String[] args) {

Change Color of Background in javaFX Canvas

倖福魔咒の 提交于 2020-01-01 14:53:27
问题 How do we change the background of JavaFX canvas? The only solution I have now is: GraphicsContext gc = canvas.getGraphicsContext2D(); gc.setFill(Color.BLUE); gc.fillRect(0, 0, canvas.getWidth(), canvas.getHeight()); Is there another solution except drawing a rectangle? I searched in CSS but canvas doesn't have -fx-background-color 回答1: The canvas is essentially "blank" (i.e. transparent) unless you draw onto it. You can create the effect of a background by placing it into a layout pane and