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
0
votes
1 answer

How to restore InputVerifier mechanism while using cancel button?

I have an InputVerifier on a JFormattedTextField. It is called when field looses focus perfectly. I added a cancel button (JButton), but do not want to call then InputVerifier when this button is clicked. MyVerifier is called when the focus is lost…
AlbertoLopez
  • 101
  • 3
0
votes
1 answer

Should user input verification be done at class level or UI level?

Say you have a console application with: Main.java and ClassA.java Your main class contains the public static void main(String[] args) method where you run your program, and it uses user input as arguments to call on methods in ClassA. Do you put…
NoName
  • 9,824
  • 5
  • 32
  • 52
0
votes
0 answers

Passing class instance in the void method

I'm trying to control button from Add Employee class so I can disable or enable it if the user input is accepted or not using InputVerifier. What I did I made a getter and setter for my addEmployeeButton public class AddEmployee extends…
Francisunoxx
  • 1,440
  • 3
  • 22
  • 45
0
votes
2 answers

getName method cannot verify JTextField from other class

I wanted to verify my other JTextField using InputVerifier method. What I did I set a named for a different JTextField using setName. private void validateJTextField() { tfAddress.setName("tfAddress"); tfLastName.setInputVerifier(new…
Francisunoxx
  • 1,440
  • 3
  • 22
  • 45
0
votes
1 answer

java extends javax.swing.jframe and inputverifier

I have need to extends javax.swing.jframe and inputverifier. Can i resilienza this problema? ?? I try to use more classes But this doesn't work. Can I use a inner class? Public class framePrincial extends javax.swing.jframe { Abstract verifica…
saverix80
  • 109
  • 1
  • 2
  • 8
0
votes
1 answer

Java Interface in InputVerifier

I have this code: public class Anagrafica implments ClientiInterface{ InputVerifier verifierAliquotaIva = new InputVerifier() { public boolean verify(JComponent input) { boolean verifica = true; final JTextComponent source…
saverix80
  • 109
  • 1
  • 2
  • 8
0
votes
1 answer

How I can make the input control verify an email address is of valid form?

I have a form and among the fields to fill is the mail I want to make a control so that the input address is consistent with the standard mails responsableTechnique.setMail(mailResponsable.getText());
Daly
  • 19
  • 8
0
votes
1 answer

Java InputVerifier find component who causes the "focus lost"

I have an InputVerifier for a jTextField and of course the InputVerifier is triggered when I loose the focus of the text field for example through clicking on a button. If I would use a FocusListener I could do: focusLost(FocusEvent e)…
Viktor Carlson
  • 989
  • 1
  • 13
  • 36
0
votes
1 answer

How to make blank fields valid until user clicks SAVE -Java

This is a simple program that uses a JDialog to add or edit work orders. When the dialog appears, the user will enter information into the fields (name, date, position, billing rate, etc.). The program must validate each of these fields. The problem…
BCRwar3
  • 45
  • 1
  • 11
0
votes
1 answer

Remove InputVerifier from JTextField

I'm really surprised this is not in the documentation or at least google. I have a class that is likely to need to remove the verifier or replace it with another one. In particular, these methods are defined in the interface: /** * Add the…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
0 answers

Validation when and how?

This question is more about a good practice to avoid code duplication when validating input data. The application imports a spreadsheet (XLS or XLSX) and instantiates an OrderList Object, which contains multiple OrderUnits (referring to each row of…
ILCAI
  • 1,164
  • 2
  • 15
  • 35
0
votes
1 answer

Custom cells on a JTable returning wrong values (and not displaying correctly)

I am writing a custom POS system and allowing users to change the quantity straight on the table instead of spawning a dialog box. Here's the first line of the table with dummy data in it. (I haven't linked it to a DB yet.) Price and Amt both have…
Sammy
  • 99
  • 1
  • 2
  • 10
0
votes
2 answers

Input verifier between textfields and radio buttons

I set input verifier to my two text fields and i want that my radio buttons should be Inactive until two text fields being verified. (User should can not select any from radio button, until text fields verify.) How inactive JRadioButtons until…
Sajad
  • 2,273
  • 11
  • 49
  • 92
0
votes
1 answer

Input Verifier on JTextField returns incorrect

This is my code, I have two text fields, tf1 and tf2 : public class MyInputVerifier extends InputVerifier { @Override public boolean verify(JComponent input) { String name = input.getName(); if (name.equals("tf1")) { …
Sajad
  • 2,273
  • 11
  • 49
  • 92
0
votes
1 answer

Set different inputVerifier for JTextFields

Here i set InputVerifier to my text field (tf1) : public class MyInputVerifier extends InputVerifier { @Override public boolean verify(JComponent input) { String text = ((JTextField) input).getText().trim(); if (text.isEmpty()) return…
Sajad
  • 2,273
  • 11
  • 49
  • 92