Skip to content
Advertisement

Tag: jtextfield

JTextField size can’t be changed

} I tried to create a form and a JTextField on it. But the problem is, my location and size doesn’t work. The TextField is filling the whole form. How can I fix it? Answer The size is not “working” due to the default layout (FlowLayout) in your JFrame. This layout doesn’t let you change the size or location of

Restrict JTextField to only accept certain characters

I have 4 JTextFields that should only accept certain characters: binary digits (0, 1) octal digits, so (0 – 7) all digits (0 – 9) all hexadecimal characters (0 – 9, a – f, A – F) The user must not be able to input a forbidden character. I know how I could validate the input afterwards, but not how

Java Swing JtextField inset

I am working with Netbeans GUI and I would like to add 3 pixels of space at the beginning of my jTextField : I have tryied with setMargin, setInset in the GUI but it doesn’t change anything. I have another question, why the bottom right border is not rounded ? here is my code : thank you very much, Regards

Advertisement