
how can u reduce the size of textfield?
thanks in advance

import javax.swing.*;
public class ReduceTextField extends JFrame {
public static void main(String[] args) {
JTextField text1 = new JTextField(20);
JTextField text2 = new JTextField(10);
JFrame f=new JFrame();
f.setLayout(null);
text1.setBounds(10,10,100,20);
text2.setBounds(120,10,100,10);
f.add(text1);
f.add(text2);
f.setVisible(true);
f.setSize(300,150);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.