textfield

Is it possible to set different colors for different lines in a javafx textField/Area?

十年热恋 提交于 2020-01-21 23:53:12
问题 I know that you can set a color of a whole textArea/Field by setting the style of the node to be -fx-text-fill: red; but is there a way to set the color of one single line instead of all of the lines while still keeping the textArea/Field editable? 回答1: JavaFX's TextField / TextArea does not support that. You can use RichTextFX for the job: import org.fxmisc.richtext.InlineCssTextArea; InlineCssTextArea area = new InlineCssTextArea(); // set style of line 4 area.setStyle(4, "-fx-fill: red;");

Special characters in libgdx's textfield do not work

泄露秘密 提交于 2020-01-20 08:13:54
问题 I can use setText("åäö") but if I type on my keyboard it doesn't show up, this doesn't work either public void keyTyped(TextField textField, char key) { JOptionPane.showMessageDialog(new JFrame(), key); } The strange thing is that it doesn't work on mac but it does work on Windows, does anyone have an answer for that? Thank You! Here's another question with a similarly topic! How do you get input from special characters in Libgdx? I have tried to get the ascii value and puting it through Gdx

Special characters in libgdx's textfield do not work

坚强是说给别人听的谎言 提交于 2020-01-20 08:08:26
问题 I can use setText("åäö") but if I type on my keyboard it doesn't show up, this doesn't work either public void keyTyped(TextField textField, char key) { JOptionPane.showMessageDialog(new JFrame(), key); } The strange thing is that it doesn't work on mac but it does work on Windows, does anyone have an answer for that? Thank You! Here's another question with a similarly topic! How do you get input from special characters in Libgdx? I have tried to get the ascii value and puting it through Gdx

Adjust row height when wrapping text in a JavaFX TableView editable TextFieldTableCell

你。 提交于 2020-01-16 10:15:11
问题 I tested one of the solutions provided here: Wrapping text in a JavaFX TableView editable TextFieldTableCell for the wrapping of the text in a cell of the TableView. The last solution does not work for me, but the one of Pavlo Viazovskyy is fine except that the whole text is only shown when I click in the table. Before the click After the click (either on the table or even in some other windows app) I tried many things, but I am not finding the was to somenow refresh the table view so that it

TextField text field doesn't return value on QML | QT 5.12

寵の児 提交于 2020-01-16 04:50:29
问题 i need an help. So this is my code: TextField { id: passwordIDText placeholderText: "Insert text..." color: "Black" font.bold: true font.pixelSize: 21 anchors.top: parent.top anchors.topMargin: parent.height / 10 anchors.horizontalCenter: parent.horizontalCenter text: "aaa" } I use Android 8 (P20), QT 12.4, Android NDK 20 and Android SDK 28. So when i click the button on the android screen (i'm using 20 to testing), in debug, for get the passwordIDText.text, the field is empty, why ?? But if

JavaFX Append to right click menu for TextField

做~自己de王妃 提交于 2020-01-14 17:54:46
问题 When you right click on a TextField there are Undo, Redo, Cut, Copy, Paste, Delete, and Select All options. I want to add a "Register" MenuItem to that list from my controller class, but do not know how. Here is what I got so far: This overwrites the existing menu items: ContextMenu contextMenu = new ContextMenu(); MenuItem register = new MenuItem("Register"); contextMenu.getItems().add(register); charName.setContextMenu(contextMenu); Both of these return null: charName.getContextMenu()

JavaFX Append to right click menu for TextField

主宰稳场 提交于 2020-01-14 17:52:49
问题 When you right click on a TextField there are Undo, Redo, Cut, Copy, Paste, Delete, and Select All options. I want to add a "Register" MenuItem to that list from my controller class, but do not know how. Here is what I got so far: This overwrites the existing menu items: ContextMenu contextMenu = new ContextMenu(); MenuItem register = new MenuItem("Register"); contextMenu.getItems().add(register); charName.setContextMenu(contextMenu); Both of these return null: charName.getContextMenu()

JavaFX Append to right click menu for TextField

情到浓时终转凉″ 提交于 2020-01-14 17:52:11
问题 When you right click on a TextField there are Undo, Redo, Cut, Copy, Paste, Delete, and Select All options. I want to add a "Register" MenuItem to that list from my controller class, but do not know how. Here is what I got so far: This overwrites the existing menu items: ContextMenu contextMenu = new ContextMenu(); MenuItem register = new MenuItem("Register"); contextMenu.getItems().add(register); charName.setContextMenu(contextMenu); Both of these return null: charName.getContextMenu()

NumberField or how to make TextField input a Double, Float or other numbers with dot

妖精的绣舞 提交于 2020-01-14 04:19:29
问题 According to comment in this question I made a custom SwifUI View based on a TextField . It use numeric keypad, you can't input there nothing but numbers and point, there can be only one point (dot), and you can pass a Bindable Double @State value through the View for input. But there is a bug: when you deleting a last zero in "xxx.0" - zero still comes out. When you deleting a dot - zero becomes a part of integer, so it goes to "xxx0" Any idea how to fix it? I tried to make value an integer

Can't set the value of a static TextField in javafx [duplicate]

喜你入骨 提交于 2020-01-11 14:10:16
问题 This question already has an answer here : javafx 8 compatibility issues - FXML static fields (1 answer) Closed 2 years ago . I'm working on a program for Insurance purposes and there I've a textfield called Reference Key this reference key is generated randomly every time I View the panel the other Scenes and classes needs this Reference Key , so I've made it static so that all the classes can reach this Instance directly ! My problem is that when I set the text for the textfield I get an