javafx

JavaFx how to align only one column-header in tableview?

馋奶兔 提交于 2020-01-02 05:31:08
问题 How to align title of only one column in tableview? The following css aligns all column-header but I want to align just one column: .table-view .column-header .label{ -fx-alignment:CENTER } 回答1: You can do that now with recent versions of JavaFX. Java 1.7 This worked for me with Java: 1.7.0_45 / JavaFX: 2.2.45-b18). It should be a recent version because it requires RT-14909 The column-header will automatically get the same "Id" as the TableColumn! Therefore your TableColumn(s) need an (CSS-)

JavaFX: Fastest way to write pixels to PixelWriter

空扰寡人 提交于 2020-01-02 05:15:13
问题 I'm looking for the fastest way to write pixels on javafx.scene.image.Image . Writing to BufferedImage 's backing array is much faster. At least on the test image I made it took only ~20ms for BufferedImage , WritableImage on the other hand took ~100ms. I already tried SwingFXUtils but no luck. Code for BufferedImage (faster): BufferedImage bi = createCompatibleImage( width, height ); WritableRaster raster = bi.getRaster(); DataBufferInt dataBuffer = (DataBufferInt) raster.getDataBuffer();

Node.setDisable() vs setDisabled() in JavaFX

不羁的心 提交于 2020-01-02 04:44:33
问题 There are two methods available for calling when inheriting from javafx.scene.Node : (I am showing off the current 8u66 Oracle implementation) setDisable(boolean) public final void setDisable(boolean value) { disableProperty().set(value); } setDisabled(boolean) protected final void setDisabled(boolean value) { disabledPropertyImpl().set(value); } Which one should I call when inheriting from javafx.scene.Node ? 回答1: It depends a bit on the context, but you almost certainly want to call

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

Deploy JavaFX on Ubuntu server without display

丶灬走出姿态 提交于 2020-01-02 04:10:07
问题 I'm developing a JavaFX application using jdk1.7.0_51 on Mac OS X (10.9.1) in Netbeans. I can run it without a problem and after a clean build I can also launch the jar from the dist/ folder. Now I want to deploy this on a 64 bit Ubuntu 13.04 server. I've had a lot of issues doing this but have finally set up the server to have the correct JRE, fonts and libraries. Running the jar resulted in errors going way deeper than my code (going to UnsatisfiedLinks to native libraries where MACOS was

Gradle for Java 11 with Modules

雨燕双飞 提交于 2020-01-02 04:08:12
问题 I'm trying to run a sample JavaFX app on Mac OS. build.gradle apply plugin: 'java' apply plugin: 'application' repositories { mavenCentral() } dependencies { compile "org.openjfx:javafx-base:11" compile "org.openjfx:javafx-graphics:11" compile "org.openjfx:javafx-controls:11" } compileJava { doFirst { println "CLASSPATH IS $classpath.asPath" options.compilerArgs = [ '--module-path', classpath.asPath, '--add-modules', 'javafx.graphics' ] classpath = files() } } Java class package com.test;

JavaFX WebEngine stuck in “Running” state

血红的双手。 提交于 2020-01-02 03:50:28
问题 While using the WebEngine in JavaFX2, I've noticed it sometimes just gets stuck. Assume I were making a crawler that simply finds hyperlinks on a page and then visits them to do the same recursively, keeping track of which links we have visited and which are already on the frontier. While running my code, the execution would sometimes hang at arbitrary moments. I've added some debug code to my project in the form of listeners to the workDoneProperty and exceptionProperty and by printing every

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 ?

Javafx fxml file TextArea line break and tab in text

一世执手 提交于 2020-01-02 03:17:12
问题 How to edit text in the TextArea in `.fxml file as such I can use line breaks and tabs . The Textarea is predefined and can not be edited. Images to support FXML File The View 回答1: If you want to directly use the text you can use something : <TextArea prefHeight="200.0" prefWidth="200.0" text="${'Multi\nLine\tTab'}" /> In case you want to use in Scene Builder, you can switch to multi-line mode. Switching to multi-line mode, scene builder will insert: for \n for \t 来源: https:/

Multiple JavaFX stages in fullscreen mode

有些话、适合烂在心里 提交于 2020-01-02 01:23:27
问题 I have an application that contains two stages which should be shown on two different screens both in fullscreen mode. I managed to position the two stages on seperate screens, and tried to set the fullscreen property to true on each Stage, but only of them is shown without decoration. It is always the one that has the fullscreen property set last that is shown in fullscreen mode. Is it not possible in JavaFX 2.2 to have multiple stages in fullscreen mode at the same time? 回答1: I also ran