This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Beginner  RSS feed

 
Greenhorn
Posts: 1
  • 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.
 
Ranch Hand
Posts: 43
  • 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)
 
Ranch Hand
Posts: 2120
  • 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.
 
Gold Digger
Posts: 7610
  • 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.
 
Sheriff
Posts: 9087
12
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!