adsterra

How to create Frame using AWT in java

Code:

import java.awt.*;
public class Testawt
{
 Testawt()
 {
Frame fm=new Frame();
Label lb=new Label("Welcome");
fm.add(lb);
fm.setSize(500,500);
fm.setVisible(true);
 }
 public static void main(String[]ars)
 {
Testawt ta=new Testawt();
 }

}

Result:



Post a Comment

0 Comments