
AWT User Interface Components 9.7
9. TextArea(“Welcome JNTU Students”,10,20);
10. frame.add(ta);
11. frame.setLayout(new FlowLayout());
12. frame.setSize(500,500);
13. frame.setVisible(true);
14. frame.addWindowListener(new WindowAdapter()
15. {public void windowClosing( WindowEvent e){
16. System.exit(0); }
17. });
18. }}
Line No. 10: We have used flow lay out at
At Line Nos. 5 and 6: we have initiated a void main(). Hence, this is NOT an applet.
At Line No. 7: we define frame to hold all our components. Frame is used for appli-
cation development using GUI components.
At Line No. 18: we have to explicitly make frame visible: frame.setVisible(true); ...