aspose file tools*
The moose likes Beginning Java and the fly likes Beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Beginner" Watch "Beginner" New topic
Author

Beginner

Gbcobra
Greenhorn

Joined: Sep 20, 2002
Posts: 1
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

Joined: Sep 06, 2002
Posts: 43
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)


_ _____ _ <br />Used to be a Java Programmer but now I work on Microsoft Technologies - Word, Excel and Outlook!
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
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.


SCJP2. Please Indent your code using UBB Code
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Gbcobra,
This question belongs to the Java in General (Beginner) forum.
I'm moving this discussion there.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
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 ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Beginner