javafx-2

How to disable a table cell for editing in JavaFX 2

情到浓时终转凉″ 提交于 2021-02-19 07:42:08
问题 In JavaFX 2, I want to disable a some cells in a column for edition. Something along the lines of TableModel.isCellEditable(row, col) in Swing. I need the item in the row to make a decision whether the cell is editable, cell value is not enough. The code I managed to write is: TableView<FilterItem> localTableView = new TableView<FilterItem>() { public void edit(int paramInt, TableColumn<FilterItem, ?> paramTableColumn) { if (paramInt >= 0) { FilterItem item = getItems().get(paramInt); //get

Highlight text in JavaFx TextArea

我是研究僧i 提交于 2021-02-11 18:20:30
问题 I have a text area like below, I need to highlight or select all the text "Highlight me". I don't find any methods to highlight the text in text area. Also I could not find any other API in JavaFX that highlights the occurrence of specific text or letter like JTextArea in Swing. Can any one suggest me on how to highlight String in the text area? Or is there any other API available apart from this text area in JavaFX? My Code: public class FXTextArea extends Application { /** * @param args *

Highlight text in JavaFx TextArea

末鹿安然 提交于 2021-02-11 18:19:23
问题 I have a text area like below, I need to highlight or select all the text "Highlight me". I don't find any methods to highlight the text in text area. Also I could not find any other API in JavaFX that highlights the occurrence of specific text or letter like JTextArea in Swing. Can any one suggest me on how to highlight String in the text area? Or is there any other API available apart from this text area in JavaFX? My Code: public class FXTextArea extends Application { /** * @param args *

Fetch icons of my System

好久不见. 提交于 2021-02-11 06:58:21
问题 I have made a program which shows my C and D drive. But the icons which are coming in my output are the default icons of javaFx. I just want to show all icons of my system. For example for videos it should show the media icon for my system, not the default icon in javaFx. 回答1: This question is similar to: How do I get a file's icon in Java? That related question does not provide a native JavaFX solution. However, there is currently no native JavaFX solution, so it would be best to: Use the

JavaFX ImageView resize in StackPane

ε祈祈猫儿з 提交于 2021-02-07 22:13:47
问题 I have a ploblem with resizing of ImageView in StackPane: If StackPane is root container and I bind image's height and width to StackPane, everything is fine. <StackPane id="StackPane" fx:id="stack" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen;" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication8.FXMLController"> <children> <ImageView fx:id="image" fitHeight="100.0" fitWidth="300.0" pickOnBounds="true" preserveRatio=

JavaFX ImageView resize in StackPane

試著忘記壹切 提交于 2021-02-07 22:13:21
问题 I have a ploblem with resizing of ImageView in StackPane: If StackPane is root container and I bind image's height and width to StackPane, everything is fine. <StackPane id="StackPane" fx:id="stack" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen;" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication8.FXMLController"> <children> <ImageView fx:id="image" fitHeight="100.0" fitWidth="300.0" pickOnBounds="true" preserveRatio=

JavaFX ImageView resize in StackPane

╄→尐↘猪︶ㄣ 提交于 2021-02-07 22:12:39
问题 I have a ploblem with resizing of ImageView in StackPane: If StackPane is root container and I bind image's height and width to StackPane, everything is fine. <StackPane id="StackPane" fx:id="stack" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen;" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication8.FXMLController"> <children> <ImageView fx:id="image" fitHeight="100.0" fitWidth="300.0" pickOnBounds="true" preserveRatio=

JavaFX ImageView resize in StackPane

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 22:12:27
问题 I have a ploblem with resizing of ImageView in StackPane: If StackPane is root container and I bind image's height and width to StackPane, everything is fine. <StackPane id="StackPane" fx:id="stack" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen;" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication8.FXMLController"> <children> <ImageView fx:id="image" fitHeight="100.0" fitWidth="300.0" pickOnBounds="true" preserveRatio=

Missing JavaFX application class

拥有回忆 提交于 2021-02-07 14:21:07
问题 I have java code like this: package mypackage; import javafx.application.Application; import javafx.stage.Stage; public class MyApp extends Application{ public static void main(String args[]){ launch(args); } public void start(Stage primaryStage){ primaryStage.show(); } } and I've compiled it at ~/myjava/src/mypackage/MyApp.class . then, when I'm running from ~$ java -cp myjava/src mypackage/MyApp why getting error like: Missing JavaFX application class mypackage/MyApp I'm using JDK 8. 回答1:

In order transition on ImageView in JavaFX

懵懂的女人 提交于 2021-02-07 14:20:37
问题 I have already looked at How to wait for a transition to end in javafx 2.1? but it doesn't quite solve my problem. I have a List of ImageView objects, and I want to iterate through this List and perform the following actions on each 'slide' of the List: fade in stay for a few seconds fade out I have the following code in place but since the transition is asynchronous, the loop applies the transition to all the 'slides' at the same time: // The method I am running in my class public void start