Results 1 to 7 of 7

Thread: hello...

  1. #1
    marj is offline Member
    Join Date
    Oct 2008
    Location
    Balayan,Batangas
    Posts
    1
    Rep Power
    0

    Wink hello...

    i'm marj!!!! i'm looking for a java codes using netbeans IDE 5.5..
    here's my codes but it's not yet been running..
    Please help me i badly need this..
    Thank you...


    /*Backbuffer application.main
    * Main.java.NoBackbuffer
    *
    */

    package NoBackbuffer;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Math;
    import NoBackbuffer1.;
    public class NoBackbuffer extends Applet
    implements MouseMotionListener {
    int NoBackbuffer1;
    int width, height;
    int mx, my; // the mouse coordinates
    Point[] points;
    int N = 300;

    public void init() {
    width = getSize().width;
    height = getSize().height;
    setBackground( Color.black );

    mx = width/2;
    my = height/2;

    points = new Point[ N ];
    for ( int i = 0; i < N; ++i ) {
    int x = (int)(( Math.random() - 0.5 ) * width / 1.5);
    int y = (int)(( Math.random() - 0.5 ) * height / 1.5);
    points[i] = new Point( x, y );
    }

    addMouseMotionListener( this );
    }

    public void mouseMoved( MouseEvent e ) {
    mx = e.getX();
    my = e.getY();
    showStatus( "Mouse at (" + mx + "," + my + ")" );
    repaint();
    e.consume();
    }
    public void mouseDragged( MouseEvent e ) { }

    public void paint( Graphics g ) {
    g.setColor( Color.white );
    for ( int j = 1; j < N; ++j ) {
    Point A = points[j-1];
    Point B = points[j];
    g.drawLine( mx+A.x, my+A.y, mx+B.x, my+B.y );
    }
    }
    }

    Here's my error:
    C:\Documents and Settings\comp5\backBuffer\src\backbuffer\Main.java :11: <identifier> expected
    C:\Documents and Settings\comp5\backBuffer\src\backbuffer\Main.java :11: '.' expected


    Please replt to my Email Add
    marj0rie25@yahoo.com..
    Thnx a lot..
    god Bless.....

  2. #2
    Paul Richards is offline Member
    Join Date
    Oct 2008
    Location
    UK
    Posts
    65
    Rep Power
    0

    Default

    I have had a look through this code and can't see whats wrong. In Netbeans, the Output window will give you a hyperlink that when you click on it, goes to the line that is causing the error. I suggest you use this and try and figure whats wrong, if you can't manage it then provide this information in another post here.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    The error is in your package import statement.

    Java Code:
    import NoBackbuffer1.;
    This is wrong defining. I hope your can figure out what the error is.

  4. #4
    Paul Richards is offline Member
    Join Date
    Oct 2008
    Location
    UK
    Posts
    65
    Rep Power
    0

    Default

    Quote Originally Posted by Eranga View Post
    The error is in your package import statement.

    Java Code:
    import NoBackbuffer1.;
    This is wrong defining. I hope your can figure out what the error is.
    Perhaps
    Java Code:
    import NoBackbuffer1.*;
    or
    Java Code:
    import NoBackbuffer1;
    ?

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  6. #6
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default additional information....

    Quote Originally Posted by Eranga View Post
    It must be actually.
    Must actually be what?
    Java Code:
    package NoBackbuffer;
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    Netbeans will do the package stuff that most of us struggle with, do not import NoBackbuffer if you are in NoBackbuffer. The Math import is done by the compiler for you.

    nospam.marj0rie25 ampersan yahoo.com will not yield replies individually. We work where everyone can see the work, someone else may be working on the same problem.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Posting Permissions

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