97 How to create frame in Java awt by extending Frame class

Code :

import java.awt.*;
class Test extends Frame
{

Test()
{
     this.setVisible(true);
     this.setSize(300,400);
     this.setTitle("Coding Atharva");
     this.setBackground(Color.RED);
}

public static void main( String args[] )
{
Test f = new Test();
}
}




Output:



Previous
Next Post »