fxml

Java FX : How to call method from controller to another controller [closed]

天大地大妈咪最大 提交于 2020-07-31 06:06:31
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 13 hours ago . Improve this question I woudlike to call method from another controller to enable/disable some Toggle Button. Dashboard_controller : // ENABLE BUTTON // public void setEnableBtn1() { btn1.setDisable(false); } public void setDisableBtn1() { btn1.setDisable(true); } My another controller : private

JavaFX Running a large amount of countdown timers at once?

江枫思渺然 提交于 2020-06-23 17:34:12
问题 So I can see a couple different ways to do what I need and I've done a bunch of google/stack overflow searching but can't find really what I'm looking for. I need to run multiple "Countdown timers." I need to have about 6 possibly up to 10 countdown timers running at once all at different times. I have a tab pane on my main program that I am including the FXML and injecting the controllers into. The Timers Tab has a different controller than the main program. So the 1st question I have is.

JavaFX Running a large amount of countdown timers at once?

牧云@^-^@ 提交于 2020-06-23 17:31:47
问题 So I can see a couple different ways to do what I need and I've done a bunch of google/stack overflow searching but can't find really what I'm looking for. I need to run multiple "Countdown timers." I need to have about 6 possibly up to 10 countdown timers running at once all at different times. I have a tab pane on my main program that I am including the FXML and injecting the controllers into. The Timers Tab has a different controller than the main program. So the 1st question I have is.

How can I add a tooltip to a node that does not implement Control using FXML?

前提是你 提交于 2020-05-14 18:00:45
问题 In JavaFX subclasses of Control have a tooltip property which means that one can declaratively add a Tooltip using FXML thusly: <CheckBox fx:id="someCheckBox" mnemonicParsing="false" text="Do It?"> <tooltip> <Tooltip text="Whether or not to do it."/> </tooltip> </CheckBox> This is possible only because CheckBox is a subclass of Control. However, I would like to be able to add a tooltip to any scene-graph Node using FXML (i.e. without having to programatically add the tooltip using Java). 回答1:

How to communicate between the Model and View in a Java FX FXML application?

懵懂的女人 提交于 2020-04-16 07:58:08
问题 Disclaimer: I'm very new to JavaFX and Model-View-Controller design principles. Here's my basic situation: I have a ScreenManager similar to the one outlined in this tutorial. Using the screen manager, I switch between several FXML screens using basic action handling on the screen buttons. The problem is that one of these is a game screen with a map. I'll be drawing a tile-based map onto this game screen, so I went with a TilePane in my FXML file(if there's a better way to draw tiles to an

FXML Label text bold

自闭症网瘾萝莉.ら 提交于 2020-04-13 17:33:28
问题 Can someone please tell me how to make the text inside a label bold in Java FXML? <Label fx:id="LegalLabel" text= "Legal Information" GridPane.halignment="RIGHT" GridPane.rowIndex="16" /> Thank you. 回答1: Give this a shot legalLabel.setStyle("-fx-font-weight: bold;"); or try making your fxml look like this <Label fx:id="LegalLabel" text= "Legal Information" GridPane.halignment="RIGHT" GridPane.rowIndex="16"> <font> <Font name="System Bold" size="13.0" /> </font> </Label> Edit: try this:

How to pass arguments in JavaFX

和自甴很熟 提交于 2020-03-26 11:03:03
问题 So, it's a little confusing but here is the thing: I created a window with SceneBuilder, and created the controller and everything, there is a button in the window. The button setOnAction() method makes the program open another window, the thing is, this other window is another class and I want to pass information to this other window, but it seems I cannot. Here's some code example: MainWindow: confirm.setOnAction(event->{ try { LibraryWindowController lwc = new LibraryWindowController();

JavaFX Slide out menu

孤人 提交于 2020-03-26 08:24:11
问题 I'm working on a project that needs a slide out menu, preferably on hover it slides out, how would I go about doing this? I want to program the slide out menu in a FXML file. Is there anyway to do this? What would I use(Split Pane, Separators)? Thanks! 回答1: Use a TranslateTransition to move the menu. Use a Pane to place the menu above the normal content. The following example doesn't use fxml for simplicity, but of course you can create the nodes from fxml too: @Override public void start