Have a play with this code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class TextValidation {
Type: Posts; User: JavaPF
Have a play with this code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class TextValidation {
Does this need to check in real-time? When the user is typing/deleting text from the field or does it check when a button is pressed?
Why can't you use if/else?
Just to clarify, if the text is deleted out of the textfield, you want it to automatically update to 0?