Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT how can u reduce the size of textfield?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


how can u reduce the size of textfield?

thanks in advance


Advertisement
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
 

 

 

DMCA.com