Input Verifier - pola wymagane poprawione

This commit is contained in:
Agnieszka Janicka 2016-06-09 21:06:19 +02:00
parent 100efa20f7
commit 264b557d48

View File

@ -29,6 +29,11 @@ public class Validation extends InputVerifier {
public Validation() { public Validation() {
} }
@Override
public boolean verify(JComponent input) {
return checkField(input);
}
public boolean checkField(JComponent input) { public boolean checkField(JComponent input) {
JTextField tf = (JTextField) input; JTextField tf = (JTextField) input;
if (required) { if (required) {
@ -37,7 +42,7 @@ public class Validation extends InputVerifier {
return false; return false;
} }
} }
if (input.getName() != null){ if (input.getName() != null) {
if (input.getName().equals("year")) { if (input.getName().equals("year")) {
if (!"".equals(tf.getText())) { if (!"".equals(tf.getText())) {
try { try {
@ -70,9 +75,4 @@ public class Validation extends InputVerifier {
return true; return true;
} }
@Override
public boolean verify(JComponent input) {
return checkField(input);
}
} }