javafx

OpenJFX 16ea on Pi 3 throws UnsatisfiedLinkError for libprism_es2_monocle.so: libGLESv2.so

本秂侑毒 提交于 2021-02-10 16:04:47
问题 I try to use a JavaFX application on a Raspberry Pi 3 B+ with a small display connected to the display port. But this throws an error on startup of the application. Maybe first some quick questions to get started: Is the display port supported by JavaFX? Because this is the first time I use it instead of HDMI. Or is OpenJFX 16ea only for Raspberry Pi 4? I downloaded latest openjfx from https://gluonhq.com/products/javafx/. This is my startup command to run the (Maven) compiled application:

Change JavaFX MenuButton Icon

匆匆过客 提交于 2021-02-10 15:53:46
问题 Is there a simple way to change a JavaFX MenuButton arrow to a character or hide it completely? MenuButton hamburgerMenu = new MenuButton("\u2630"); hamburgerMenu.getItems().addAll(new MenuItem("Ham"), new MenuItem("Buger")); 回答1: Add the following style to hide the arrow .menu-button > .arrow-button > .arrow { -fx-background-color: transparent; } Result You can also define a different SHAPE using -fx-shape followed by a SVG path. .menu-button > .arrow-button > .arrow { -fx-shape: "M 0 -3.5 v

How to fix Exception in Application constructor

拜拜、爱过 提交于 2021-02-10 14:38:43
问题 I'm new in Javafx, I just downloaded JDK 12 and followed a tuturial, it has worked but not worked for me, (I'm using module to require javafx.controls) here is the code: in my main class : I tried a lot of solutions in SOFlow but no result, I tried : 1) add public keyword to my class 2) removed the main method still not work help ? package com.teachersdunet.hellojavafx; import javafx.application.Application; import javafx.stage.Stage; public class HelloApp extends Application { public static

TableView cell word wrapping

别来无恙 提交于 2021-02-10 12:58:02
问题 I want to create a cell where i can wrap the text this is my solution what i've got so far: tableCol.setCellFactory(param -> { return new TableCell<Data, String>() { @Override protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (item == null || empty) { setText(null); setStyle(""); } else { Text text = new Text(item); text.setStyle("-fx-padding: 5px 30px 5px 5px;" + "-fx-text-alignment:justify;"); text.setWrappingWidth(param.getPrefWidth() - 35); System

TableView cell word wrapping

非 Y 不嫁゛ 提交于 2021-02-10 12:57:34
问题 I want to create a cell where i can wrap the text this is my solution what i've got so far: tableCol.setCellFactory(param -> { return new TableCell<Data, String>() { @Override protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (item == null || empty) { setText(null); setStyle(""); } else { Text text = new Text(item); text.setStyle("-fx-padding: 5px 30px 5px 5px;" + "-fx-text-alignment:justify;"); text.setWrappingWidth(param.getPrefWidth() - 35); System

Printing TableView Contents in JavaFX

♀尐吖头ヾ 提交于 2021-02-10 11:47:50
问题 I am learning JavaFX. I created my TableView and populated it with data. I added a Button such that when it is clicked, the table contents can be printed. Here is the whole code for : `public final class TableViewSample2 extends Application { private TableView<Person> table; private ObservableList<Person> list; public void createTable() { table = new TableView<>(); table.setEditable(true); list = FXCollections.observableArrayList( new Person("Jacob", "Smith", "jacob.smith@example.com"), new

JavaFx: ComboBox Table Cell double click

送分小仙女□ 提交于 2021-02-10 10:22:50
问题 The problem is the following: I have a TableView with ComboBoxes where for every TableCell I can select a value from the comboboxes. The problem is, if I have a lot of rows and columns I have to click a lot to select the appropriate value in every comboBox. To select a value in a combobox I have to click four times to select the value. Once to select the cell, once to set the graphics the comboBox, again to open the popup for the combobox where I can select the value and finally to select the

JavaFX mp3 playback Ubuntu 14.04

风流意气都作罢 提交于 2021-02-10 08:21:45
问题 I am trying to play mp3 file in java program using javafx. I installed dependencies libavcodec53 and libavformat53 mentioned here. I used following code public void play(String path_to_song){ JFXPanel fxPanel = new JFXPanel(); String song = new File(path_to_song).toURI().toString(); Media audio =null; audio = new Media(song); MediaPlayer mediaPlayer = new MediaPlayer(audio); mediaPlayer.play(); } But I still got error "Error media audio format unsupported" Exception in thread "main"

CheckComboBox(ControlsFX) set to read only [JavaFX]

北战南征 提交于 2021-02-10 07:27:09
问题 I have been trying to figure out how to set CheckComboBox to read-only. I do not want to disable the CheckComboBox because I want the user to be able to scroll and look through the already checked items, however I want to disallow the ability of checking/unchecking an item. Is there a way to do this? 回答1: Hacky and fragile, but works: public class CheckComboReadOnlySkin<T> extends CheckComboBoxSkin<T> { public CheckComboReadOnlySkin(CheckComboBox control) { super(control); ((ComboBox)

Why aren't Bindings working with Transitions

偶尔善良 提交于 2021-02-10 06:28:26
问题 I have a Circle and its centerX property is bound to the text property of a label. This is for viewing the position of the object on screen. The binding seems to stop working whenever I apply a transition on the circle. This is a snippet from the code. //ERRONEOUS PART OF CODE Circle circle = new Circle(50, 20, 20); Label posLabel = new Label(); //binding StringBinding binding = new StringBinding(){ {bind(circle.centerXProperty());} @Override public String computeValue(){ return Double