• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

First applet

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And yes, it is homework. However I'm not asking for anyone to do it for me!

We are using Eclipse SDK Ver. 3.2

The problem:
make an applet like this...
3D Ball

I figure to use the circle from the smile face code in our book(Problem Solving with Java) and insert two ovals within it at different widths. This is the code I have so far...



The part in bold is just to remind me of what I want to do. He also wants the source as "<applet code="minor3.class" Width=115 height=115>
</applet>"

Now my questions are....

Can I accomplish my goal this way?

Am I missing any steps that need to be done?

Is this the correct Import and public class to use to end with a "minor3.class"?

I'm almost 60 yrs. old, and suck at math, can someone please help me set the math involved? (This is the only part I will ask for someone to do it )

I don't know how the younger generation learns this stuff so quick!

Thanks,
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For this case, it may be best to use the JavaDoc for the Graphics class to understand the drawOval() method -- the parameters are pretty straightforward.


But... "Fedje", Welcome to the JavaRanch.

You may not have noticed that we have a policy on screen names here at the ranch. It must consist of a first name, a space, and a last name. It must also not be fictitious.

Unfortunately, your screen name does not seem to conform with this policy. Please take a moment to change it.

Thanks,
Henry
[ October 08, 2006: Message edited by: Henry Wong ]
 
Linda Guy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Henry, that helps a little. I've been all over the Internet with tutorials etc., and never found that one. I hope it sets up the same way.

Sorry about the name, it's fixed.
 
Linda Guy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I've been working on this off and on all afternoon. An applet will come up but not initialize. I get one error I can't find out how to fix. In the methods section the 'void' shows the error..."Syntax error on token "void", Identifier expected after this token."

How can I fix this? I'm getting a headache.
(But I'm so proud I got this far!)

Thanks, Here's my code so far....

 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Okay, I've been working on this off and on all afternoon. An applet will come up but not initialize. I get one error I can't find out how to fix. In the methods section the 'void' shows the error..."Syntax error on token "void", Identifier expected after this token."



You need to be able to successfully compile an applet before you can run it -- so I am not sure what you mean by "Applet will come up but not initialize", as you seem to be describing a compile problem.

Anyway, the compiler generally provides the file and line number location it thinks the problem is. You need to use the editor on the file, go to that line, and tell us where it is. We can't exactly tell from the post.

But if I had to take a guess on where the compile error is ...



This is not a valid syntax. First, you never named the method. Second, putting the semicolon between the parameter list and the open brace, is probably not what you intended. Third, if you meant the paint() method, then the method should not be static...



BTW, you still have other problems. But this is probably the main one that you are encountering...

Henry
 
Linda Guy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKS HENRY!! That was the place I was trying to say. I now have the circle! There's hope for this old lady yet! Now to work on the ovals inside it.

Think I can figure it out before Wednesday when it's due?
 
reply
    Bookmark Topic Watch Topic
  • New Topic