Questions tagged [jtextfield]

JTextField is a Java Swing component that allows the editing of a single line of text.

JTextField is a lightweight component that allows the editing of a single line of text. For information on and examples of using text fields, see How to Use Text Fields in The Java Tutorial.

2960 questions
0
votes
0 answers

jTextField accept only one dot in java calculator?

I have created a simple calculator in java using net beans. In this calculator when user accidentally press dot button(jButton) multiple time textfield shows many dots as user pressed. for example if user press dot button after five three times it…
Arkam
  • 1
  • 1
0
votes
2 answers

Program with JFrame won't start

I was trying to write a program, where you put some numbers in a JTextField an then it does something with it. I tried figuring out how to even make an input possible. But the way I'm trying it doesn't work despite Eclipse showing no errors. And…
user9871751
0
votes
1 answer

Java JTextField setPlaceholder not working

just a quick question but I have a little Gu set up which has a JFormattedTextField. I want the text box for date entry and I want the textbox to show "yyyy-mm-dd". When I use the following code it doesn't work:
dateFormatter = new…
tarquin
  • 137
  • 2
  • 13
0
votes
1 answer

How to show JComboBox's selected item in JTextfield when it selected otherwise not?

I wrote small program for search Person's Name via Text field as I can search in mobile phone Contacts. I put 5 names in combo box, when I search 'a' then it shows all 5 names because each have character 'a', then I select 3rd or 4th name by mouse,…
Mandar Khire
  • 49
  • 2
  • 10
0
votes
2 answers

Check if JTextfield value exist in ArrayList

I'm trying to check does inputed room number exist in array list: private void initAction(RoomsWindow rw, RoomAddUpdateWindow raw) { btnConfirm.addActionListener(new ActionListener() { @Override public…
Neo Cortex
  • 47
  • 1
  • 11
0
votes
1 answer

Converting String input to Integer from JTextField with Integer.parseInt but still receiving error message

textSeventh is a JTextField I am using a submit button with an action listener Code: String amountInput = textSeventh.getText(); System.out.println(amountInput); import java.awt.GridBagLayout; import java.awt.GridLayout; import…
GSGlv
  • 1
  • 1
0
votes
0 answers

JTextField - Call event after not editing in n seconds

Is there any listener or event to check latest time user input in JTextField? I want to call a function whenever user stop input in n seconds.
Quan Nguyen
  • 559
  • 4
  • 23
  • 47
0
votes
1 answer

Listener that runs a certain code only when the ENTER key is pressed while the Mouse is in a JTextField?

here is the code for the ENTER key pressed and the Mouse in the TextField separately. What I need is for the program to only run my code when the mouse is inside of the JTextField while ENTER key is pressed. Thanks for any help! string is what I…
DvZ
  • 1
0
votes
1 answer

Can't show all object's properties through jTextField

I am having a problem with trying to display each separate object's properties (e.g. ID, Title, etc) in a jTextField. I am able to get the output for the last object in the list, but I am unable to access the ones before it when I click on them in…
Julia Dune
  • 19
  • 3
0
votes
1 answer

How to get the value of JTextField in Java Swing?

I have a JTextField and a JButton. I'm trying to get what user types in the textfield when they click the button. public String insideTextField; public void login() { loginFrame = new JFrame("Test"); …
0
votes
1 answer

How to automatically focus JTextField?

Right now im making a small commander with a JTextField as inputField. How do I automatically focus this when the window opens? There is nothing else to do than inserting something into the field and pressing Enter at the end.
0
votes
0 answers

JFrame JTextField Hiddentext Ghosttext

My JFrame Login Window has the Textfields "Benutzername" and "Passwort". So if i wanna enter my username and password I must first delete these two Textfields. How can i implement these as a "Hiddentext" or "Ghosttext" that it stands in the…
C.Ser
  • 1
0
votes
1 answer

Get a value from Jtextfield3 from jtextfiled1 and 2

I need to see a value which means if jtextfiled's text is as "abcd" and jtextfield2 text as "efg" I need to see out put as in the 3rd jTextfield as "abcdefg" .
Manu
  • 5
  • 4
0
votes
0 answers

JLabel won't show up on JPanel

Help is needed :) My friends and I are coding hangman in school for a project, and we're really stumped on one part. We made a JFrame and an outer JPanel (Background), then divided it into two columns (the left column is functional as we like). Our…
Turkey
  • 1
0
votes
1 answer

How can i disable jbutton when pressed 10 times

I need some help about Java GUI. I want to add 10 numbers to memory from JTextField. And when it's done JButton must gonna be disable and program must show me a message dialog. How can I do this? import java.awt.BorderLayout; import…
1 2 3
99
100