Most voted "jtextfield" questions
Jtextfield is a java-swing component that allows the user to edit a simple line of text.
Learn more…26 questions
Sort by count of
-
6
votes2
answers437
viewsHow to access jTextField statico created with swing?
So guys I got one jTextField that works normally but when I put it as static the setText no longer works, and I need it static because I pass the same to a function, I did it without the swing and…
-
5
votes1
answer384
viewsProblem with Java timer
Explanation: I have a component JTextField that would be a regressive counter, but when I use the ActionListener in this way: public static ActionListener alredBGolem = new ActionListener() { public…
-
4
votes1
answer1129
viewsHow to add values in Jtextfield via the button without deleting the previous value?
My problem is that I put a button so that when it was clicked, add the value 1 in JTextField. However, when I click again, it replaces the value, and what I wanted is for it to add another 1 like, I…
-
4
votes1
answer669
viewsDecorating a Jtextfield with an icone
My question is whether it is possible to "decorate" a field, like Jtextfield or Jformattedtextfield, with an icon. An example would be something like this: Following an example, I made the following…
-
3
votes2
answers2185
viewsTransparent java background
I have a problem with background transparent of a JTextField, by changing the content of JTextField it seems to superimpose the text and get all mixed up: I’m setting the background like this:…
-
3
votes1
answer1530
views"Transparent" text in java
I wanted to do a text similar to this: This "transparent" text, when clicked it disappears and you can start writing in the dialog box... someone knows how to do it in Java? Help me, people, help…
-
3
votes1
answer545
viewsChange Jtextfield value from another class or automatically
I found some similar issues in the English version, but I could not resolve. I have a boiler class, with the following attributes: Boiler temperature; how much; Fire temperature; In this program I…
-
2
votes1
answer74
viewsHow to put Outlines in the text
I would like to know how to put black Outlines in the text JLabel label_name = new JLabel(); label_name.setPreferredSize(new Dimension(100,20)); label_name.setForeground(Color.white);…
-
2
votes1
answer3610
viewsMonetary mask for Jtextfield
I have a field JTextField which must receive a monetary value from the user. I would like to add a mask to this field so that it format the inserted values as follows: 9.999,99.
-
2
votes1
answer424
viewsHow to show a jPopupMenu just below a jTextfield?
My intention is to create a search field where you type and appear the data of a query in the BD as a popup menu. I got this, it’s working. I created the menu and I can show it on the screen with…
-
2
votes2
answers2905
viewsJtextfield null field validation
On my system, I have a window and a controller, but for some reason, it is never launching the error as expected : Method of validation : private void validacao(){ if((form.txtNome.getText() !=…
-
2
votes1
answer741
viewsHow to leave only one edge on Jtextfield?
I wonder how to leave only one edge on one JTextField, similar to data entry when logging into Gmail, that is, with a border at the bottom.
-
2
votes1
answer264
viewsError adding placeholder to a text component
I am implementing the component of this topic together with the following instruction: PromptSupport.setPrompt("Digite..", field); This command is from biblioteca swingx-core-1.6.2 and adds a sort…
-
1
votes1
answer253
viewsAutocomplete in jTextfield - adapt class
I was able to find here a code for autocomplete in a jTextfield. As I am new to programming, I have tried to adapt this code to use in Jtextfields of other classes I have but I haven’t been able to.…
-
1
votes1
answer692
viewsI cannot delete input from a Jformattedtextfield
I am making a program and it uses some formatted Jtextfields, that is, Jformatedtextfield that calls a Maskformatter. The problem is that by writing a message and trying to erase it, the message…
-
1
votes1
answer135
viewsProblem inserting Jtextfield inside Jpanel inside Jtabbedpane
I have a Swing app where the main window consists of a JtabbedPane which contains some extended classes JPanel [Viewprincipal, Viewcadastro, Viewrelatorio, etc...]. When I add Jlabels and Jbuttons,…
-
1
votes1
answer176
viewsKeylistener for various Jtextfields
I created a KeyListener for verification of a String typed, if it is in the bank. If it does, it sends an alert. The question now is that I have about 50 jTextFields. It is possible to create a…
-
0
votes1
answer276
viewsJtextfield formatting with CPF mask
Would anyone know how to answer me as I leave a field JTextField with the CPF mask. I think you can do this by setting a Document to the JTextField, but I don’t know how to do it. Someone could help…
jtextfieldasked 9 years, 5 months ago fbarros 3 -
0
votes0
answers197
viewsCustomization of Textfield javafx
Hello, I would like to know how to customize my Textfield to leave with this same style ("http://codepen.io/Wakkos/pen/hCquc"), but without color change. I found this code, but I’m having trouble…
-
0
votes1
answer274
viewsJtextfield that accepts only two letters
How do I make it in a JTextField, I can just type two letters of the keyboard and not use any other letter, number or character? For example: in a field I just want it accepted either the letter T…
-
0
votes1
answer3397
viewshow to take a textField value and move to an int variable?
How do I get the value typed in a field of the type JTextField and move on to a variable, so I can do calculations later? I tried to use getText(), but the variables being int, do not receive the…
-
0
votes1
answer217
viewshow to position a Jtextfield’s Caret?
I have a JTextField where opening and closing of parentheses is optional. However, whenever the user opens and does not close a parenthesis, my program gives error, because I use this text field to…
-
0
votes0
answers40
viewsHow do you make Jtextfield behave like Combobox?
I wonder if there’s a way to turn my Jtextfield into some sort of combo box. I would like that when I type something, this data is automatically relating to some database and appear options of…
-
0
votes0
answers81
viewsHow to pass data from a Jtextfield to a Postgresql Date field
I urge you to help me solve a problem of entering data type Date (SQL) to register new students in the Crud project developed by me in the code below. The method containing the INSERT INTO command…
-
0
votes0
answers10
viewsFill in Jtextfield from jComboBox
I have a. txt file with strings like this: luis;123;456;789;11/11/1111 The first part of my problem was popular jComboBox only with the first value (name), I managed to do some good, but now I need…
-
-1
votes1
answer1961
viewsJtextfield does not interpret n as line breaking
When printing customer data in Jtextfield, when the \n is present means a line break, but instead of moving to the next line each time you find a \n, he simply ignores and continues to write in…