Print at Dec 21, 2025, 11:36:12 PM

Posted by rohanbhanu at Jun 7, 2013, 6:57:59 PM
Re: Basic Code Required
Dear,
As you have mentioned I have tried using applet but it is showing me error:
Code of Applet init method:

public void init(){
Container c=getContentPane();
c.setLayout(new FlowLayout());
JLabel jtemp=new JLabel("Demo Label");
c.add(jtemp);
Class c=Class.forName("com.eteks.sweethome3d.model.Home");
Home hm=(Home)c.newInstance();
Class l=Class.forName("com.eteks.sweethome3d.model.Wall");
Wall w=(Wall)l.newInstance();
w.setThickness(10);
w.setLeftSideColor(20);
w.setRightSideColor(200);
w.setXStart(WIDTH);
hm.addWall(w);
c.add(hm);
}


It is showing error in c.add(hm); statement.