Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


NetBeans and Java Help


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 synntax33   Members   -  Reputation: 109

Like
0Likes
Like

Posted 07 November 2012 - 08:18 PM

Hey all, looking for some help:D I decided to teach myself how to program. I am running Ubuntu 12.04 on a dual core laptop, 3GB Ram. I went with Python for a couple of days, and after some more reading, decided to swap over to Java, since when I finally get around to making a game, I would want it cross platform easily? Anyway, so I have been working throught the Java tutorial trail, using NetBeans IDE, and honestly, some of the stuff just doesnt work. Is this typical with Java? I type the code out line for line on the CreatObjectsDemo,

public static void main(String[] args) {
// Declare and create a point object
// and two rectangle objects.
Point originOne = new Point(23, 94);
Rectangle rectOne = new
Rectangle(originOne, 100, 200);
Rectangle rectTwo =
new Rectangle(50, 100);

and it compiles errors like these

Compiling 1 source file to /home/skull/NetBeansProjects/CreatObjectDemo/build/classes
/home/skull/NetBeansProjects/CreatObjectDemo/src/creatobjectdemo/CreatObjectDemo.java:19: cannot find symbol
symbol : class Point

location: class creatobjectdemo.CreatObjectDemo
Point originOne = new Point(23, 94);
/home/skull/NetBeansProjects/CreatObjectDemo/src/creatobjectdemo/CreatObjectDemo.java:19: cannot find symbol
symbol : class Point

location: class creatobjectdemo.CreatObjectDemo
Point originOne = new Point(23, 94);
/home/skull/NetBeansProjects/CreatObjectDemo/src/creatobjectdemo/CreatObjectDemo.java:20: cannot find symbol
symbol : class Rectangle


It is using the JDK 1.6 library, am currently having issues getting it to add platform 1.7 would the library be the cause of this issue?
Any thanks will be greatly appreciated :D

*edit* there are indents in the code, copy and paste is right on preview, shows no indents on submittal? *meh*

Edited by synntax33, 07 November 2012 - 08:27 PM.


Sponsor:

#2 Aldacron   GDNet+   -  Reputation: 3241

Like
0Likes
Like

Posted 08 November 2012 - 06:39 AM

Hey all, looking for some help:D I decided to teach myself how to program. I am running Ubuntu 12.04 on a dual core laptop, 3GB Ram. I went with Python for a couple of days, and after some more reading, decided to swap over to Java, since when I finally get around to making a game, I would want it cross platform easily? Anyway, so I have been working throught the Java tutorial trail, using NetBeans IDE, and honestly, some of the stuff just doesnt work. Is this typical with Java? I type the code out line for line on the CreatObjectsDemo,


You apparently didn't type it out line for line. The full source includes Point and Rectangle classes. The errors you get about not finding Point and Rectangle mean you have not implemented them in your code.

*edit* there are indents in the code, copy and paste is right on preview, shows no indents on submittal? *meh*


Wrap your code in code blocks... [ code ] [ /code ], but without the spaces.

public static void main(String[] args) {
	    // Declare and create a point object
	    // and two rectangle objects.
	    Point originOne = new Point(23, 94);
	    Rectangle rectOne = new
			    Rectangle(originOne, 100, 200);
	    Rectangle rectTwo =
			    new Rectangle(50, 100);

Edited by Aldacron, 08 November 2012 - 06:41 AM.


#3 synntax33   Members   -  Reputation: 109

Like
0Likes
Like

Posted 08 November 2012 - 12:45 PM

Ok, so looking at your example, I see the error. The tutorial page linked Point and Rectangle which are apparently separate objects. The tutorial page doesn't include all the code at once, I overlooked the first time. Your link has all of it at once, I will try it that way. Thanks for the reply and help, it is much appreciated.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS