javafx

how to generate button(picture) based on checkboxes selection in javafx

守給你的承諾、 提交于 2019-12-25 03:16:01
问题 My question is how to generate buttons, set with car pictures, based on the checkboxes and/or radio buttons selected by a user in javafx? I'm simulating a car dealership website with car pictures. The user should be able to filter the pictures displayed by clicking checkboxes and/or radio buttons selection. I'm first creating all the picture buttons with a for each loop. I could use if and if/else statements to filter through the pictures but there would be duplicates. I've heard of

How to select/highlight next row in TableView (JAVAFX)

青春壹個敷衍的年華 提交于 2019-12-25 03:15:14
问题 I'm making a media player in JavaFX. I'm displaying the songs in a TableView object. And whenever I press the Skip button, I would like it to highlight the next row, so that the user can see which song from the playlist, that he is listening to. This is the code for the TableView. I would like it to get the selected element, and then select/highlight the next element for me, whenever a certain method gets invoked. @FXML private TableView<Song> defaultTableView; // 1) Song Title @FXML private

JavaFX Button isn't clickable

梦想与她 提交于 2019-12-25 03:05:07
问题 So I have this button. It can be pressed with the enter key, and can be selected through tabbing to it, but it cannot be clicked on, and doesn't appear to exist as far as the cursor is concerned. I don't believe anything is covering it, but it most be covered some how, as a button created with identical code is clickable. public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ primaryStage.setTitle("Mortgage Calculator"); GridPane pane = new

Filter users values on TextField input after a BindDirectional strategy betwen a Slider and min/max TextField

和自甴很熟 提交于 2019-12-25 02:57:59
问题 Using two TextField : texMin and texMax , i want to limit min and max values of my doubleSlider control (cf the custom ui control DoubleSlider here : http://code.google.com/p/javafx-widgets/source/browse/#svn%2Ftrunk%2FDoubleSlider%2Fsrc%2Fdouble_slider ) The DoubleBinded with StringConverter (double to string) works perfectly, but now i don't know how can i filter to get only correct values entered by user in the two TextField after it ENTER keypress.. I don't know if a setOnKeyReleasedEvent

How to pause/resume a song in javafx?

偶尔善良 提交于 2019-12-25 02:57:11
问题 I'm making a playlist based mp3 player using javafx and I got everything working except how to pause/resume a song. I tried simply checking the player.Status() and using that but it didn't work so I stored the time of the song when pause() is clicked, in a Duration pausetime variable and it works that way but only once. What happens is: I click pause() , it works, click play() , it resumes the song but after that the pause button stops doing anything. Btw I'm using two separate ToggleButton

JavaFX - loading FXML file error

心已入冬 提交于 2019-12-25 02:40:39
问题 I have strange problem which is concerned to loading FXML file using Scene Builder 1.0. I have created a class Warrning and after that I add to my package a FXML file and called it WarrningGUI . Creator has created a Contoller class called WarrningGUIContoller . Until then everything was fine. I stared to create a layout for my application. After I added two raw Panels and turned on and off my FXML file in Scene Builder about 2-3 times something like that appeared: And this was in "Detail":

JavaFx Css not working with eclipse

谁都会走 提交于 2019-12-25 02:29:33
问题 I'm new to JavaFx and I'm trying to set up a style. I was flowing a tutorial but I hit a wall I can't get pass. No matter what I do in the CSS file it as no effect on the App. public class LoginForm extends Application{ public static void main(String arg[]){ launch(arg); } @Override public void start(Stage primaryStage){ GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25,25,25,25)); Scene scene =new Scene(grid,300

Torus 3d in javaFX 2.x

一世执手 提交于 2019-12-25 02:16:05
问题 I've Stage which is divided by Split Panel, and I wants on the right pane create a 3D torus. First: I don't know what can I create torus. Second: I don't know on what kind of obiect can I create this Torus. Pane enough? Please for help. 回答1: You won't be able to create an embedded 3D scene with a Torus using JavaFX 2.x without a lot of custom coding on your part. However this becomes easy if you use JavaFX 8 and the third party 3D library F(X)yz: http://birdasaur.github.io/FXyz/ F(X)yz has a

Putting an object on a stage when mouse clicked

北慕城南 提交于 2019-12-25 02:12:00
问题 package javafxapplication36; /** * Copyright (c) 2008, 2012 Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. */ import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; import javafx.beans.InvalidationListener; import javafx.beans.Observable; import javafx.event.ActionEvent; import javafx.event

Getting series color from LineChart

断了今生、忘了曾经 提交于 2019-12-25 02:08:53
问题 LineChart has series which have different color by default. How can I get it to set obtained color to other text connected with the specified series? 回答1: In a line chart since all elements of a single series have one color. The series are assigned with styleclass series0 , series1 , series2 etc. Each of these series are assigned with corresponding colors styleclass i.e. default-color0 , default-color1 , default-color2 etc. You can directly use the styleclass for your text/labels. 来源: https:/