Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP!!! free format drawing.

 
Graham Porter
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there, i hope you can help. I was wondering...is it possible to write an applet that would enable the web user to do a drawing on the web page? I.e perhaps draw some rectangles etc and lines connecting them? If so how would i do this.
Any help would really be appreciated.
Graham.
 
Andrew Shafer
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The answer is yes.
It is spelled AWT and/or Swing.
Please move this to the Applet forum.
 
Graham Porter
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
o, ok, sorry about that, didn't realize.
One quick question though....whats the difference between an applet and a servlet. I'm guessing applets run on the client side and servlets run on the server but is that the only difference and why would you pick one over the other?
Graham.
 
Andrew Shafer
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It isn't really an either or situation.
You can have both.
It just depends on what you are trying to do. If you need to connect to a Database for example, you gotta have a servlet involved. If you want people to be able to draw stuff as you have described, has to be an applet.
Servlets work in a request/response sequence of events between a client and a server, generally using HTTP and dynamically generating html.
Applets are like applications that run on the client side, but they have more security restrictions. (unless they are signed, which is basically asking for permission) Applets are invoked using tags in html.
You can build your UI as an Applet and let a Servlet handle the business end. You really don't have to choose between them. Your case will dictate which is more appropriate to use.
 
Andrew Shafer
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

To do what you originally described, I suggest learning about applets, which will inevitably lead you to awt/swing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic