File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Beginner

 
Gbcobra
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new at Java and am taking it for college and could use some help. So if i ask a stupid question dont laugh. I have to write an applet that asks for 4 arguments and using drawRec then it draws a rectangle. now when i go to display the numbers entered. g.drawRec how do i get the numbers that were entered by the user to draw the rec? I have written everything else just stuck on the end when it actually draws the rectangle.
 
Bishal P
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not an application where u can have the command prompt for users to enter the data. You can however pass these values using the param tag of applet.
Otherwise you can design HTML pages such that text box take the size as input and then u pass the value to applet (not sure if the second part is possible)
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch GBcobra.
Please read our naming policy and change your displayed name accordingly.
I think this isn't the forum to get the better replies to your question because Applets aren't part of the objetives for the exam.
Try not doing cross post.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gbcobra,
This question belongs to the Java in General (Beginner) forum.
I'm moving this discussion there.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gbcobra:
I have to write an applet that asks for 4 arguments and using drawRec then it draws a rectangle. ... How do I get the numbers that were entered by the user to draw the rec? I have written everything else just stuck on the end when it actually draws the rectangle.

When you get the numbers from the user, you assign them to variables. Then you use those variables in the drawRect(int x, int y, int width, int height) method.
[ September 23, 2002: Message edited by: Marilyn de Queiroz ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic