raveen
how can u reduce the size of textfield?
1 Answer(s)      5 years and 3 months ago
Posted in : Swing AWT

how can u reduce the size of textfield?

thanks in advance

Ads

View Answers

September 29, 2011 at 11:49 AM


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);
          }
    }









Related Tutorials/Questions & Answers:
Advertisements