javafx-8

JavaFX 8 count rows in “textarea”

旧街凉风 提交于 2020-07-16 08:27:03
问题 We are trying to count the number of rows in a TextArea Here are the TextArea properties PrefWidth 600 and PrefHeight 620 with MaxHeight 620 Wrap Text is set to true. We are using JavaFX 8 with Scene Builder We have a textPropertyListiner that will fire an Alert when the TextArea.getLength is greater than some value The issue with this method is it does not consider the user entering a carriage return \n So we implemented this code to capture the \n String toCount = txaDiaryEntry.getText();

How to make auto re-sizable border pane for “drawer” menu

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-09 12:51:49
问题 I have BorderPane as my Root. Left side contains slide-out menu and center has container to keep components. I want to stretch the length of my main container to the width of the stage, when slide-out menu is hiding and opposite. I tried to scale my BorderPane mainContent by ScaleTransition, but it goes wrong. ScaleTransition just stretch , do not set width... @Override public void start(Stage primaryStage) throws Exception{ Label label = new Label("->"); label.setStyle("-fx-text-fill: orange

JavaFX GridPane: Shrink if content is disabled and invisible

落花浮王杯 提交于 2020-07-04 03:28:12
问题 Is it possible to shrink a GridPane row if the content of that row is both disabled and invisible? When I set a Node to disable=true and visible=false, the cell still takes up space. If I have 8 rows and only the first and last is visible I don't want the empty rows to take up much space. As if there was only two rows. The only "solution" I could find was to set the size to zero. However I do not consider that a good solution. I would have to store the min/max size to set it back when/if the

Styling of subelement of RadioButton in JavaFX using CSS

烂漫一生 提交于 2020-06-29 09:49:17
问题 I'm trying to change the appearance of the RadioButton in JavaFX by using CSS, but facing the problem. According to the JavaFX CSS Reference Guide element structure consists of subelements: radio — Region dot — Region label — Label Subelement radio stylized in modena.css: .radio-button > .radio, .radio-button:focused > .radio { -fx-background-radius: 1.0em; -fx-padding: 0.333333em; } By overriding these style classes are configurable appearance of subelement. Sub .dot stylized too. But... if

Sharing screen via Java socket programming

不想你离开。 提交于 2020-06-29 03:59:46
问题 I am trying to send the live screen of the client to the server. It's a one-way communication till now. They seem to connect, but somehow the whole data might not be sent. I can't understand where the problem lies. Only a still image is shared in spite of a continuous stream of images. Will I have to use another AnimationTimer in the server-class and how? If not, how can I achieve a live sharing of the screen? My code is as follows: Image info class shared by both server & client: package

Getting Null Pointer exception and Can't understand why

自作多情 提交于 2020-06-28 08:11:25
问题 My program seems to work fine when scrolling up and down in the main ListView . The problem happens when I open a TitledPane and scroll down or up fast using the mouse scroll-wheel. I also noticed that if I use the mouse to drag the scrollbar after opening a TitledPane , everything works fine. I would like to think that I am very good a spotting and fixing my NullPointer errors, but this one has me baffled. How do I pinpoint the cause of the error and how do I fix it. I can probably figure

Getting Null Pointer exception and Can't understand why

做~自己de王妃 提交于 2020-06-28 08:10:20
问题 My program seems to work fine when scrolling up and down in the main ListView . The problem happens when I open a TitledPane and scroll down or up fast using the mouse scroll-wheel. I also noticed that if I use the mouse to drag the scrollbar after opening a TitledPane , everything works fine. I would like to think that I am very good a spotting and fixing my NullPointer errors, but this one has me baffled. How do I pinpoint the cause of the error and how do I fix it. I can probably figure

How to apply a blur only to a rectangular area within a pane?

别等时光非礼了梦想. 提交于 2020-06-28 06:36:35
问题 Let's say I've got a StackPane which has a BackgroundImage as background and another StackPane (or another component, if neccessary) as a child. The child covers only a part of the parent StackPane . I'd like to know how to apply a GaussianBlur just to the area the child covers, so that the BackgroundImage is blurry in this area. The size of the child changes when the parent is resized. It would be perfect to get a solution that will resize just in time, too. 回答1: If you want to do it

button inside column for each row in tableview

回眸只為那壹抹淺笑 提交于 2020-06-28 03:46:37
问题 In my TableView I have column with button for each row for update so I need when click the button to take all the values from the row to a new fxml window This is my contractor class: public class constractor { private String co_id; private String co_name; private String co_address; private String co_create_date; private String co_description; private String co_mobile; private String co_type_compile; private String co_status; private String co_type_model; private Button button; public

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.