Results 1 to 5 of 5
  1. #1
    shital is offline Member
    Join Date
    Dec 2010
    Posts
    3
    Rep Power
    0

    Angry problem with arc2d

    i am new to java & trying to run code shown below


    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ArcExample extends JPanel
    {
    public void paintCamponent(Graphics g)
    {
    Super.paintCamponent(g);
    Graphics2D gd=(Graphics2D)g;
    arc2D a=New arc2D.Float(10.0f, 10.0f, 100.0f, 100.0f, 0.0f, 90.0f, Arc2D.OPEN);
    gd.draw(a);
    }
    public static void main(String args[])
    {
    JFrame f= new JFrame ("ArcExample");
    ArcExample e=new ArcExample();
    f.setContentPane(e);
    f.setsize(200,200);
    f.show();
    }


    but i got error at arc2D a=New arc2D.Float(10.0f, 10.0f, 100.0f, 100.0f, 0.0f, 90.0f, Arc2D.OPEN);

    & error is "; expected"
    can anybody help me to solve this plzzzzzz

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    The keyword 'new' is with a lowercase 'n', not 'N'. 'New' is just an undefined variable. b.t.w. what is 'plzzzzzz'?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    shital is offline Member
    Join Date
    Dec 2010
    Posts
    3
    Rep Power
    0

    Default error

    thanksss
    i done i bt naw i got run time error "exception in main thread"
    what should i done

    & before that i also got note that
    arc.example uses or overrides depricated api
    recompile with -xlint:deprication for details

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by shital View Post
    thanksss
    i done i bt naw i got run time error "exception in main thread"
    what should i done

    ....
    Please edit your post to correct the non-standard abbreviations it contains. These are not necessary and confusing, especially for the members here who don't speak English as a first or second language. Your cooperation is much appreciated.

  5. #5
    shital is offline Member
    Join Date
    Dec 2010
    Posts
    3
    Rep Power
    0

    Unhappy sorry

    i extreamly sorry for inconvenience!!!
    i had done changes in my code as per your instructions
    but i got notes that

    arc.example uses or overrides depricated api
    recompile with -xlint:deprication for details

    & after that i got run time exeption
    exeption in main thread

    cde is this

    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ArcExample extends JPanel
    {
    public void paintCamponent(Graphics g)
    {
    Super.paintCamponent(g);
    Graphics2D gd=(Graphics2D)g;
    arc2D a=new arc2D.Float(10.0f, 10.0f, 100.0f, 100.0f, 0.0f, 90.0f, Arc2D.OPEN);
    gd.draw(a);
    }
    public static void main(String args[])
    {
    JFrame f= new JFrame ("ArcExample");
    ArcExample e=new ArcExample();
    f.setContentPane(e);
    f.setsize(200,200);
    f.show();
    }

    what should i do
    please suggest me

Similar Threads

  1. Arc2D.PIE help
    By MZA in forum Java 2D
    Replies: 4
    Last Post: 09-30-2009, 07:26 AM
  2. Arc2D.Double coordinates
    By alley in forum Java 2D
    Replies: 2
    Last Post: 11-07-2007, 10:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •