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
Post a Comment