Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 21st, 2005, 04:35 PM
skiboka33 skiboka33 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 skiboka33 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 29 sec
Reputation Power: 0
billiard table

Hi, I'm a university student and a begginer java user in a CSC course. First 5 or 6 assignments were very easy, so I started slacking a bit I suppose, but now it's caught up with me because I have no idea what I'm doing for this assignment. The assignment is to create an applet in which a billiard ball bounces against the walls of a 2D billiard table. This might seem simple to some of you, but is a big step up from the other programs such as printing out a list of prime numbers or drawing a checkerboard which we have been assigned.

In the assignment description it gives us this hint to get started:

public class BilliardTable
{
private Color tc;
private int tx, ty, tw, th;
public BilliardTable (Color tc, int tx, int ty, int tw, int th);
public void draw (Graphics g)
public Color getTableColor ()
public int getTablex ()
public int getTabley ()
public int getTablew ()
public int getTableh ()
} //BilliardTable class

And I'm thinking that we're supposed to create a BilliardTable class, a BilliardBall class and a Billiards Applet. I tried:

public class Billiards extends Applet
{
public void paint
{
this.tc = tc;
this.tx = tx;
this.ty = tx;
this.tw = tw;
this.th = th;
g.setColor(tc);
g.fillRect(tx, ty, tw, th);
} //paint
} // Billiard Applet

As you can probably see, I really don't know what I'm doing, which would explain the 10-15 compiler errors... So I'm wondering, do I draw my table in the Applet part? or the "public void draw (Graphics g)" part from the hint? Anything would help and would be greatly appreciated, and thankyou for having patience with a beginner.

Reply With Quote
  #2  
Old March 22nd, 2005, 03:41 AM
skiboka33 skiboka33 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 skiboka33 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 29 sec
Reputation Power: 0
there's no one who can help? I'm not asking anyone to do my assignment for me, just a hint or anything to get me started, thanks.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > billiard table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT