School project

I am having some trouble with this program. The goal of the program is to make a checkerboard. It keeps saying draw(java.awt.Shape) in java.awt.Graphics2D cannot be applied to (CheckerBoard) pen.draw(bask); and is also giving me an instantiationexception error during runtime. I have no idea how to fix the instantiationexception error can anyone help.
import java.applet.Applet;
import java.awt.Rectangle;
import java.awt.Graphics;
import java.awt.Graphics2D;
public class CheckerBoard extends Applet{
public void paint(Graphics g) {
Graphics2D pen = (Graphics2D) g;
     final int NSQUARES = 8;
     int size = Math.min(getWidth(), getHeight()) / NSQUARES;
     CheckerBoard bask = new CheckerBoard(NSQUARES, size);
          pen.draw(bask);
for (int i = 0; i < numSquares; i++){
for (int j = 0; j < numSquares; j++) {
          int inj = (i + j) % 2;
if (inj == 0)
Rectangle r = new Rectangle(i * size, j * size, size, size);
pen.draw(r);
public CheckerBoard(int aNumSquares, int aSize){
     numSquares = aNumSquares;
size = aSize;
int numSquares;
int size;
}

draw(java.awt.Shape) in java.awt.Graphics2D cannot be applied to (CheckerBoard)
pen.draw(bask);The compiler message is saying that your pen is a Graphics2D, bask is a CheckerBoard (a sort of Applet) and a Grapics2D does not know how to draw a CheckerBoard.
You can get a look at all the things a Graphics2D can do by looking at the API documentation: http://java.sun.com/javase/6/docs/api/java/awt/Graphics2D.html
So you should take that line out - or if you meant it to do something, describe that.
(It's a good idea to post your code here using the "code" tags. Put [code] at the start of your code and [/code] at the end - including the square brackets. It is also a good idea to use spaces, rather than tabs, to indent code. And to copy and paste actual code and complete error/compiler messages.)

Similar Messages

  • Is it possible to create a schedule in Labview . Example: i want to off the lights at 7pm and want it on at 8am. If there is can anyone teach, its for a school project. Im using labview 2011

    Is it possible to create a schedule in Labview . Example: i want to off the lights at 7pm and want it on at 8am. If there is can anyone teach, its for a school project. Im using labview 2011...thx

    Since this is a school project I recommend you do the work yourself. You will not learn asking others to do it for you. In addition, folks here will not do your homework for you. We are however more than wiling to answer specific questions for you. Post what you have done or tried and ask specific questions. I am confident you will get assistance.
    And to answer your question, yes LabVIEW can be used to implement a scheduling program.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Trying to get 4 clips on the screen at once for school project - HELP!!!:)

    Hi there,
    I am trying to finish a school project about a fieldtrip which we have been on over the past few days and want four clips from the movie I have made to be on in the background while the title comes on the screen for each day.
    Can anyone help please? I have seen some plugins but cannot afford to buy them just for this video but am desperate to make it look how I want it!
    Thank you all in advance,
    Matt Williams

    You might try to use the button windows for your seperate movie clips. These can be moved about and enlarged. Try this site, it does a good job with an overview http://www.kenstone.net/fcphomepage/idvd_5stone.html
    The other way if you want only short portions of the four clips you can make them into short quicktime clips and drop them into the dropzones of a theme that has 4 drop zones. You do this by editing your clip (split at playhead) and sharing to QT then put in the drop zone.
    Not entirely sure what you are trying to do but hope that helps.

  • I lost my iLife DVD and need to download iDVD for a school project! I didn't mean to uninstall it!!! Where can I get it!!!

    I lost my iLife DVD and need to download iDVD for a school project! I didn't mean to uninstall it!!! Where can I get it!!! Some one smart about iDVD please save me! Thank you.

    Hi
    If You lost it - You need to get a new one. There are no free or legal downloads AT ALL.
    • Second handed from e-bay
    • See if Amazon - got any boxed iLife'11 DVDs left (cheque that iDVD is included)
    Apple do NOT sell any more.
    Yours Bengt W

  • Datawarehouse school project

    Hi, I'm student and I want to do a school project with Oracle. My project is about datawarehouse. I want to build and work with oracle database and oracle data mining with datawarehouse databases.
    I want to know if I can download oracle database and installed it on my own pc (It's only for school purpose objetives). I need some license?
    I think I need installed Enterprise Edition for data mining, it's true? Can I use for my school project?
    Can I download any datawarehouse sample database?
    The are any tutorials or similar for it?
    Thanks you very very much!!!

    Hi,
    Yes, you need to install the DB Enterprise edition.
    This is available off of OTN.
    I know that folks will download for evaluation.
    You will have to check the license to see how it applies to your efforts.
    Thanks, mark

  • FINAL SCHOOL PROJECT

    hello,
    i am almost finishing my final school project.
    i would like to show it to some of you before i send it to my school
    perhaps someone can give me their opinion about it?
    thanks!

    GMX750 wrote:
    .... show it to some of you .... Post the code here and it becomes public.

  • Copied School Project from DVD-Burn New Copy?

    I copied my son's school project from a school-supplied/created DVD to my hard drive. Now I'd like to make my own copy. Can I do this? Do I need to get the DVD again to make an image instead? Or, can I copy to my Palmcorder and then import as a file? Thanks.

    @J Keller
    Roxio Toast can burn these to a new DVD, but I'm not aware of any Apple apps that can handle those files without other processing.
    DVDSP can also address Video_TS folders (however most folks don't have apple's professional apps).
    So I'd agree that Roxio Toast (or Apple's DU) is his best option here.
    Btw ... If I'm not mistaken, I remember reading that you can also try dragging your Video_TS and Audio_TS into the blank disc icon in the Finder and burning it from there.
    http://discussions.apple.com/thread.jspa?messageID=1973820&#1973820

  • My daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    my daughter has created an imovie for a school project, last time she did this and downloaded it onto her memory stick the teach could not play it on their windows pc, how do we convert it or change it so the teacher can play.  thank you

    Meg\'s Dad wrote:
    …  I assume this format is what is needed to play on the class "Smart Board" also? …
    here in ol' Europe, school boards use chalk and are not smart …
    h264.mp4 is actually the most common 'standard' (4000 video 'standards' aaaaand counting)
    mp4 is indeed universal (Mac, Windows, Linux), and since YouTube, the h264 codec has a good installed base .....
    you can bump into probs only when it comes to sheer amount of data:
    for instance cheap 'digital frames' are sortof over-whelmed, if you try to playback 720/30p in high quality.
    I'm not familiar with 21st cent devices as SmartBoards ... again, it could happen, you have to reduce resolution/fps/bit-rate to avoid clutter&stutter in the video.
    I'm using such encoded files successfully on Playstation3, WD HD TV or flatscreenTVs with integrated usb-connection (via stick), etc
    imho, it should work welll .............. < fingers-crossed >

  • Render problems_please help school project is due :(

    Im working on a school project and everything seems to be working fine but im running into this problem...
    After capturing from an xl2, the raw capture files play perfectly...
    but as soon as i drag and drop my file into the timeline in FCP and render (still within FCP) , the video gets these horizontal banding. It mostly occurs during quick or sudden movements by the subject. I initially thought it just looked like that on the viewer and would go away when i export it out, but it still has it.
    below is a link of a still showing the banding.
    http://i17.photobucket.com/albums/b92/clockwurk/banding.jpg
    any help would be very much apprciated. my project is due monday
    thank you in advance.
    2.0 Mhz G5   Mac OS X (10.4.8)   1.5 gigs RAM

    wow. kudos to you, man. you've got a to learn on your own, that's too bad about your instructor. luckily the web is full of great resources and here's one of the best on digital video
    http://www.adamwilt.com/
    your xl2 shoots interlaced video as well as progressive scan video in a different framerate. the perception is that 24p is cool and whatnot but it can come back and bite ya if you don't even know what regular ntsc video is. i urge you to not mess with 24p until you've got ntsc 29.97 fps video under your belt a bit more.
    field order errors that david referenced are in that necessary bit of engineering that you now need to learn. all video isn't the same so you need to know what you're working with. minidv is DV25 and with some creative googgling, you can find the proper field order.
    there's a ton of great informative fcp websites out there. http://www.kenstone.net/fcphomepage/fcp_homepageindex.html for one. you may want to subscribe to larry jordan's free newsletter if you've not already. http://www.larryjordan.biz/
    regarding your render issue, that will go away when you match your clip properties and sequence properties. go over thoroughly how to set up your project and sequence settings based upon what kind of video your working with.
    we're here to help. you'll find you'll get better support by trying to help yourself first however by taking advantage of the manual and little used SEARCH function on this forum.
    good luck.
    zeb
    3 antiques from the PowerPC age and 4 bicycles   Mac OS X (10.4.8)   On the shores of da Nile.
    3 antiques from the PowerPC age and 4 bicycles   Mac OS X (10.4.8)   On the shores of da Nile.

  • I ordered my iPhone 5 on the 1st of October 2012. it says delivers october 30th. How can I get it faster? I need it to take pics of my school project.

    I really can't wait for my new iPhone 5. I am worried because I need it to take picsures of a project I am making in school. I have to take pictures of almost every step in the process. I am starting next week and I will be carrying it out over the next 8 months. Becasue I live in ireland and america is on top of apples priority list for iPhones, I have to wait 3-4 weeks for it to dispatch and 3-7 working days for it to ship. I think that this is a bit disgraceful on Apples part. I mean I am payingthe full price of €790 for the phone, they least they could do is have it delkivered to me sooner. I mean I will be missing out on a whole month of use, not to mention the fact that it released 2 weeks later in ireland. Not only that but Apple should know at this stage that the supple of iPhones usually runs low within the first few weeks of sale, they should have pushed back the release date to allow more menufacturing time. Anyway, back to the point. Is there anything I can do to get my iPhone earlier?

    No

  • Question bout school project

    i am doing a project for school and i need to know what region apple targets and what age group and what religion and what race and ethnics group. if you can answer any of these plz respond thanks

    Did you read the Terms of Use before you agreed to them? Sorry,this forum is for technical support only.
    SubmissionsStay on topic. Apple Support Communities is here to help people use Apple products and technologies more effectively. Unless otherwise noted, do not add Submissions about nontechnical topics, including:
    Speculations or rumors about unannounced products.
    Discussions of Apple policies or procedures or speculation on Apple decisions.
                             4. Do not post polls or petitions or links to same.
    Maybe you should contact Apple directly:
    Apple
    1 Infinite Loop
    Cupertino, CA 95014
    408.996.1010
    Message was edited by: Ingo2711

  • Want to convert youtube video for school project

    I have downloaded a file from you tube. I think it is in the mp4 format. Now I would like to view and possibly insert it into a imovie project for school. Do I need to convert it first? If so, where do I get a converter?

    Hi -
    You can try MPEG Streamclip as the convertor.
    It is available free from;
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    The format and pixel dimensions of the material you downloaded will influence what you choose to convert to with MPEG Streamclip.
    MtD

  • VDP School project.

    I'm in the last year of school and for my final exam, I got to do a project about Veeam and VDR. I need to figure out which one of the backup solutions that is best for a small vsphere office enviroment. I've been researching for so many days but i dont seem to get anything out of it. Im a rookie when it comes to backup, and I could really need some help.
    Could anyone, on a basic level tell me about all the VDP feautures, and try to convince me why VDP is the best solution for a small office enviroment over Veeam backup free v8.
    I've got a lab enviroment where i can test these two backup solutions, and compare them to eachoter. But i wont get anything out of it if i dont understand what i am testing.
    Remember, this is about a SMALL enviroment, where vDPA is probably not an option, because of the cost. But, you could tell me what the advantages of getting vDPA would be.
    Please, help me out right here. Im pretty stressed out..

    The latest version of VDP is 6.0 and all of earlier VDPA functionality is now available with VDP 6.0 You can also refere this white paper for details on VDP 6.0 - http://www.vmware.com/files/pdf/vsphere/VMware-vSphere-Data-Protection-Overview.pdf

  • SD report for school project

    Hi Experts,
    Please may I get some guidance, I have a course work project as I am studying BW and I need to produce a report for a SD case.  The report needs to show the following:
    Characteristics
    Sales Organization
    Delivery Date (From/To)
    Shipping Point
    Sales District
    Vehicle Route
    Vendor/haulier
    Key Figures
    Delivered Qty (Volume)
    Delivered Qty (Weight)
    Delivered Qty (SKU)
    Shipment Cost Value
    I am taking the following steps to find the above:
    1.  In R/3 > SD look at datasources to find the fields required.
    2. Once datasources have been identified to transfer to BW and activate the business content
    3. Identify the cubes used by the datasource (AWB>Infosource and look at dataflow for the datasources I found containing required fields).
    For any GAP analysis identified I will provide field, table and user exit for ABAP programmer.
    Are these the correct steps?  Have I missed anything?  Also could someone please provide a template document I can use to write up the requirements as a blue print?
    Thanks for your help in advance, I will award points for help.
    Vic Kumar Manni

    Yes thank you, I was looking at all the datasources in SD so thanks for point me to these ones.
    As a starting point is it helful to look at Christopher Solomon tables and check for fields in SE11?
    Also, any tips for report layout/ blue print?
    Thanks,
    Vic
    Edited by: vic manni on May 27, 2008 6:02 PM

  • School project VI design for a computer

    I am a sophomore mechanical engineering student and in need of some help. In my ENGR 201 (Evaluation and Presentation of Experimental Data) our final project is to design a VI for a bicycle speedometer using LabVIEW. I fell asleep halfway through reading the guidelines and wanted to ask if I can use an alternative idea (not saying the bike speedo would be difficult). One of my passions is computers. I was wondering if anyone has any suggestions on relating this to a project design. Possibly designing a motherboard etc etc.
    I'm not sure if this is overly ambitious considering my limited labview knowledge, but I know I'd have a lot more of an easy time researching how to do this instead.
    Is there anywhere I can find some example projects or template VIs...
     Thanks

    I am not sure i understood, what you want, but take a look here.
    Also look at the Labview examples. Some of them are quite interesting

  • For a school project what ideal apple hardware do I need to connect an office of 11 lawyers, 8 paralegals, 7 secretaries, 1 office manager and 1 receptionist?

    I have to suggest the hardware for a final project and I want to suggest everythin apple.

    R C-R wrote:
    If the office is already wired for Ethernet cabling, you don't need anything besides a wired router with enough ports.
    If you want to go with a wireless network, an Apple Airport Extreme Base Station would be a great choice, assuming all the computers on the network have WiFi (Airport) capabilities.
    Or then again, maybe I misunderstood that question

Maybe you are looking for

  • Problem seeing a jframe components

    Hello, My problem is this. I have a main jframe. Now on my main jframe i have to do a time expensive procedure called refresh(); While this procedure is running i want to display a message in a JWindow that says "Please wait". Problem is that no matt

  • Security Settings for two admin groups  with shared service

    Hi all, I use Essbase Administration Services 11.1.2 and Hyperion Shared Services Console 11.1.2.0.73 (Drop 17) Access Rights are granted via Groups in Hyperion Shared Service Console. We have two admin groups. AccessGroup 1: admin rights on some cub

  • LabVIEW & RF Test Engineer Opportunity - Maryland

    Looking for a LabVIEW developer with experience in RF system test and measurement to join an exceptional team in the Columbia, Maryland area.  The position is time-critical - if you're contemplating a career change and meet the qualifications, please

  • Query on NI PXI 6602 Timing I/O Module

    How to configure the PXI 6602 Timing I/O module to generate frequency on 8 lines and measure the frequency using the same card?

  • About replication& datatransfer in  sap srm.

    Hi dear friends, In srm is't required ,Both Replication  (meterial/vendor ) and  Data transfer .  And pl tell me the difference b/w above.                    thanks&regards                          sairam