java.AWT - setSize() method -


i facing issue using setsize() method in below program.

error : method setsize(int,int) not defined type frame.

when see java api, "class frame" has method inherited class java.awt.window. have instantiated frame class, object should have setsize() method frame derived class of window. why getting error then? how can derived class doesnt contain superclass method?

public class awtprac{    public static void main(string[] args) {     frame fm = new frame("java programm");     button b= new button ("click here");     fm.add(b);     fm.setvisible(true);     fm.setsize(300,300);     fm.dispose();   } } 

take code

   import java.awt.frame;    public class awtprac  {  private static  void init(){     frame fm = new frame("java programm");    fm.settitle("awtprac");    fm.setsize(300,300);     fm.setvisible(true); }  public static void main(string[] args) {     init(); }  } 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -