javafx

Display ToolTip on PieChart

笑着哭i 提交于 2019-12-25 01:59:46
问题 I want to display Tooltip when I move mouse pointer on PieChart. I tested this code: private ObservableList<Data> pieChartdData = FXCollections.observableArrayList(); private PieChart chart = new PieChart(pieChartdData); public void pieChart(List<FSPartitions> obj) { for (FSPartitions obj1 : obj) { String fsName = obj1.getFSName(); double usedSize = obj1.getUsedSize(); for (Data d : pieChartdData) { if (d.getName().equals(fsName)) { d.setPieValue(usedSize); return; } } } for (FSPartitions

Autosize text area into tabpane in javaFX

假如想象 提交于 2019-12-25 01:56:08
问题 I hava 3 tabs in a TabPane that each one has a text area with different texts and different length. I want to autosize text area according to it's length in each tab. I don't understand what should I do ? using scene builder ? css ?javaFX methods ? Thank's in Advance ... 回答1: I think you are asking that the text areas grow or shrink according to the text that is displayed in them? If so, see if this code helps: import java.util.concurrent.Callable; import javafx.application.Application;

How do you specify that you want your elements in a ToolBar to be centered?

点点圈 提交于 2019-12-25 01:55:54
问题 For some reason, JavaFX's ToolBar only proposes two options for items alignment: LEFT_TO_RIGHT and RIGHT_TO_LEFT . And funnily enough, if this is RIGHT_TO_LEFT you have to specify your items in reverse order so that they show up naturally... However I don't see any option for aligning elements in the center . How do you achieve that? Or must I use something else than a toolbar? edit: here is the current code... Unfortunately this doesn't work :( FXML: <BorderPane xmlns="http://javafx.com

Inserting images into TableView rows - JavaFX

谁说胖子不能爱 提交于 2019-12-25 01:55:32
问题 Just wondering how to insert an image into cells of a TableView in JavaFX. I have read other peoples solutions on this site but struggle a tad understanding them as I think their set up is a bit different to mine. Pretty much I am making a game library, and in the tableview I want an icon of the game. The data is being read from a .dat file (in which this case a String of the icon's URL), and all the strings in the rows work. The column is made @FXML private TableColumn<Game, Image> iconCol;

Java OOP using Translate Transition and JavaFX

不羁岁月 提交于 2019-12-25 01:49:09
问题 The Translate Transition does not output. It uses a method in the main class. I believe it is not working because it is used as an object. There has to be a different code to implement. It uses a method in a main and then puts it into a tester. However, I do not know how to use it because it uses a constructor/object as well. Then, the object turns and changes into a node which I changed it. I do not know how the Translate Transition method is attached to the object and displays it into the

How to run RFID tag listener method in javafx project?

一世执手 提交于 2019-12-25 01:46:47
问题 I am working on a project involves RFID technology, what i am trying to do at the moment, once the RFIDTagListener method runs, I basically pass a tag to a reader which its serial number will be sent to a server to get some relevant data back and pop them on a GUI screen. what I have done so far is getting the data upon sending reader's data manually without passing a tag becasue I don't know how to do it otherwise and here is the problem. where I am working on a javafx project and when I

how to set up two timelines to one app?

孤人 提交于 2019-12-25 01:45:10
问题 I have a problem with timeline collision. I have working clock pane with animation timeline and I wanted to add a stopwatch with its own timeline. As I want them working together what I have to change as right now when I start stopwatch a cannot stop it as its keep restarting? clock application public class Clock extends Application { @Override // Override the start method in the Application class public void start(Stage primaryStage) { ClockPane clock = new ClockPane(); // Create a clock

JSwing simple button/JFXPanel layout

不打扰是莪最后的温柔 提交于 2019-12-25 01:44:58
问题 can someone please tell me the simplest way to achieve the layout in the image below in Java? The JFXPanel should take all the screen space except for the button that should remain of the same size when the window is resized. More generally, is there any LayoutManager in Java that lets me stack components one over the other in a simple way? Everything I've tried makes the button way too large. Maybe the JFXPanel messes with the sizing, I don't know. Thank you, this is driving me mad. 回答1: Use

IntelliJ artifact build not running from terminal

时间秒杀一切 提交于 2019-12-25 01:34:46
问题 I'm running Ubuntu 16.04 LTS with IntelliJ Idea Community Edition. Having finished my desktop application I wish to export to run as a standalone application. I have JRE9 installed. Following the quick 60 seconds tutorial in this video, which is also the same as on the IntelliJ web site tutorial. So I go to Project Structure, Artifacts, Add, Go to JavaFX tab, select the main class, OK, the build the artifact, open the containing folder and... Double clicking the .jar file says it's not

ComboBox and ChoiceBox don`t show content

妖精的绣舞 提交于 2019-12-25 01:32:44
问题 ComboBox and CheckBox set element's inside it https://ibb.co/7YWQfLh, but don't display this element's https://ibb.co/Mfy2mZb I create boxes in different panes ( HBox , VBox , AnchorPane , GridPane ), result the same. I used Enum and usual String and result the same. public class TestFXController { @FXML private ComboBox<String> asd; @FXML private ChoiceBox<String> fgh; @FXML void initialize() { ObservableList<String> langs = FXCollections.observableArrayList("Java", "JavaScript", "C#",