Questions tagged [inputverifier]

An InputVerifier validates input in Graphical User Interface (GUI).

In Java, an InputVerifier validates input in Graphical User Interface (GUI). See How to Use the Focus Subsystem: Validating Input for an example.

52 questions
1
vote
2 answers

Revert jTextField to last good value

I have an InputVerifier for a jTextField to check and see if the input from the user is an integer. If it is not, I want to revert it to the last good value. How do I to this? Here is the code I have so far: class IntegerVerifier extends…
Rich C
  • 3,164
  • 6
  • 26
  • 37
1
vote
1 answer

JButton does not gain focus immediately after setEnabled(true)

I am trying to make an intuitive user interface where the user would enter the numeric values into the JTextFields, advance with the TAB key and finally activate the button to start processing the input. At the beginning the button is disabled and…
Chupo_cro
  • 698
  • 1
  • 7
  • 21
1
vote
1 answer

use abstract class inputverifier java in another class

I have two classes public class Finestra extends javax.swing.JFrame{ ........ jtextField.setinputVerifier(.....): } public abstract class Verifica extends InputVerifier{ String message; public Verifica(String message){ } …
Agatino
  • 11
  • 3
1
vote
3 answers

How to trigger Java Swing InputVerifier on enter in JComboBox (actionPerformed)?

I have a Swing JComboBox with an InputVerifier set correctly. I am using the combo box to set an integer. If I type "cat" in the field and hit tab, my InputVerifier triggers and resets the value to "0". If I type "cat" and hit enter, my…
Alex B
  • 24,678
  • 14
  • 64
  • 87
1
vote
1 answer

Inputverifier cell editor

I have a table with a currency amount in one column. The difficulty is that each row can have a different currency. I have set up a default cell editor which does the validaion in stopCellEditing which works fine. If the data is invalid the…
user4031188
1
vote
1 answer

JTextField requires me to give it focus a second time before making proper updates

In my project I have a JTextField for dates to be entered in. I have an InputVerifier to ensure proper information is entered and to also do some work with it. One of the things I need is to get the DAY_OF_WEEK from the entered date. I do so with…
exit_1
  • 1,240
  • 4
  • 13
  • 32
1
vote
1 answer

JFormatted Field yielding focus when it shouldn't

The other day I asked a question, here, and received a suitable answer. However, when I tried to convert the sample code into my own program and begin to morph it into my needs, it wasn't working the way it should. I've gone through both sets of…
exit_1
  • 1,240
  • 4
  • 13
  • 32
1
vote
2 answers

How can you validate the first column of a JTable with regex?

I'm making a program, and I have to validate whether the first column is an IP-Address or not. So far, I have only figured out how to find how to filter a row. But it is the column that has to be checked before I write the data to a file. Can…
user3332136
  • 159
  • 1
  • 2
  • 6
1
vote
1 answer

InputVerifier don't display each component icon(lable)

I have a form that set a input verifier to it. I want when a user type a correct value for a text field and want to go to other text field, a check icon should be display besides of text field. But now in my code, when user type a correct value on…
Sajad
  • 2,273
  • 11
  • 49
  • 92
1
vote
1 answer

JTextField InputVerifier

I set input verifier to my text field: public class MyInputVerifier extends InputVerifier { @Override public boolean verify(JComponent input) { String text = ((JTextField) input).getText(); try { BigDecimal value = new…
Sajad
  • 2,273
  • 11
  • 49
  • 92
1
vote
2 answers

InputVerifiers not activating when programatically setting text

I have a swing application with JTextFields that I attach InputVerifiers to. I have valid defaults applied to the fields via the setText method, e.g. this.myField.setText("11"); But it seems that public boolean verify(JComponent component) doesn't…
Stealth Rabbi
  • 10,156
  • 22
  • 100
  • 176
1
vote
0 answers

How to verify the JComponents

public void actionPerformed(ActionEvent ae){ String userName = userNameTxt.getText(); char[] pass = password.getPassword(); } I want to validate the above fields( its username and password) I want to take only alohabet(a-z) in username and…
newBrain
  • 103
  • 1
  • 1
  • 9
0
votes
3 answers

Adding textfield validation to multiple textfields

I'm trying to add validation to 4 JTextFields using only numeric characters (0-9). The code I have for one JTextField is: txtf_xCoord.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent keyEvent) { …
drizzy
  • 139
  • 2
  • 15
0
votes
1 answer

How do I make the main form show only if the user login is successful from a second form?

I am trying to make a form that verifies user login. I want that form to show first then, if the user login is successful, the main form should show. this is what I have tried(in the second form): private void button1_Click(object sender, EventArgs…
Ciel
  • 25
  • 6
0
votes
1 answer

JTable cell validation via Regular expression

Is there a way to validate each cell of my JTable with Regular expressions?
Eder
  • 1,874
  • 17
  • 34