|
Sweet Home 3D Forum » List all forums » » Forum: Installation » » » Thread: Basic Code Required |
|
| Print at Feb 7, 2026, 11:19:21 PM | View all posts in this thread on one page |
| Posted by rohanbhanu at Jun 4, 2013, 10:49:35 PM |
Basic Code RequiredDear All, I am using SweetHome3d in servlet. I am new in Java and dont understand how to use this api for my application. I request you to give me some sample codes. I am using Eclipse as development tool. Thank you in advance, Rohan bhanu [email protected] |
| Posted by Puybaret at Jun 4, 2013, 11:03:12 PM |
|
Re: Basic Code Required In servlet!?! What for? ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by rohanbhanu at Jun 5, 2013, 10:33:21 AM |
Re: Basic Code RequiredI am attaching code for reference. try { Class c=Class.forName("com.eteks.sweethome3d.model.Home"); Home hm=(Home)c.newInstance(); hm=new Home(); hm.setName("rohan"); hm.addLabel(new Label("MyHome", 1, 11)); Level arg0 = new Level("rohan",20,1,3); out.print("asdasdasd"); hm.addLevel(arg0); hm.getPrint(); hm.setModified(true); Room rom; Room room=new Room({{},{}}); hm.addRoom(room); }catch(Exception e){out.print(e.getMessage());} Using this code I can initialize the home class. But what is method to display the home preview after adding walls and furniture. |
| Posted by Puybaret at Jun 5, 2013, 10:42:39 AM |
|
Re: Basic Code Required Sorry but I still understand why you speak about servlets? What is your goal? ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by rohanbhanu at Jun 5, 2013, 10:52:53 AM |
|
Re: Basic Code Required OK let me know you. My goal is to develop website in which user can create his/her own view for their own house. They will upload image and draw walls,may add furniture as per their requirement. I want to build the web application as same as sweet home 3d has developed online application. For this reason I have downloaded the jar file. Imported in my eclipse IDE and start using classes developed by SweetHome3d. |
| Posted by rohanbhanu at Jun 5, 2013, 12:23:59 PM |
|
Re: Basic Code Required hello Emmanuel Puybaret, I am waiting for your reply. |
| Posted by Puybaret at Jun 5, 2013, 1:05:48 PM |
|
Re: Basic Code Required I think you are on the wrong path. Servlets won't help you (at least in a first step) and you'd rather study applets and how it works in Sweet Home 3D Online case. I'm ok to give you a few hints but sorry I can't spend time on teaching you the basics of Java technology itself. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by rohanbhanu at Jun 7, 2013, 8: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. |
|
|
Current timezone is GMT Feb 7, 2026, 11:19:21 PM |