Questions tagged as 'jtextfield'

1
answer

Error adding placeholder to a text component

I'm implementing the component of this topic along with the following instruction: PromptSupport.setPrompt("Digite..", field); This command is from biblioteca swingx-core-1.6.2 and adds a kind of placeholder . But using it t...
asked by 14.07.2017 / 02:15
1
answer

How to show a jPopupMenu just below a jTextfield?

My intention is to create a search field where you go typing and displaying the data of a query in the DB as a popup menu. I already got it, it's working. I created the menu and I can show it on the screen with the data, but the position is the...
asked by 29.04.2015 / 20:15
1
answer

How 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); label_name.setText("Este é um exemplo");...
asked by 16.07.2014 / 03:52
1
answer

KeyListener for multiple JTextFields

I created a KeyListener to check for a String typed, if it is in the database. If yes let it proceed, if not, issue an alert. The question now is that I have about 50 jTextFields . Is it possible to create a KeyListener...
asked by 03.12.2017 / 20:07
1
answer

Problem inserting JTextField into JPanel that is inside JTabbedPane [closed]

I have a Swing application where the main window is composed of a JtabbedPane that contains some classes that extend JPanel [ViewPrincipal, ViewCadastro, ViewReport, etc ...]. When I add JLabels and JButtons, they appear and win...
asked by 21.04.2017 / 21:38
1
answer

Autocomplete in a jTextfield - adapt class

I was able to find here a code to autocomplete a jTextfield. As I am new to programming, I have already tried to adapt this code to use in JTextfields of other classes that I have but have not yet achieved. I tried to put this part of the c...
asked by 10.11.2014 / 13:32
1
answer

I can not delete the input of a JFormattedTextField

I'm doing a program and it uses some formatted JTextFields, that is, JFormatedTextField that calls a MaskFormatter. The problem is that when writing a message and trying to delete it, the message comes back, making it impossible to leave the fie...
asked by 02.12.2014 / 21:38
1
answer

JTextField that accepts only two letters [duplicate]

How do I make it possible for me to enter two letters on the keyboard and not use any other letter, number, or character in a JTextField ? For example: in a field I only want it accepted either the letter T or the letter F (upper case)....
asked by 07.07.2017 / 14:50
1
answer

how do I get a value from the textField and pass it to an int variable?

How do I get the value typed in a field of type JTextField and pass to a variable, so I can do calculations later? I tried to use getText() , but the variables because they are int , do not receive the content. I wanted to...
asked by 17.03.2017 / 06:50
1
answer

Formatting JTextField with CPF Mask

Would anyone know how to respond to me as I leave a JTextField field with the CPF mask. I think you can do this by setting Document to JTextField , but I do not know how to do it. Could someone help me? Note: I want to use...
asked by 01.07.2015 / 21:56