Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / JAVA help...

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 16th Dec 2003 05:21 Edited at: 16th Dec 2003 05:33
in my APCS class, we are learning to program in JAVA. and i need help.

We did a project at school, but i did it all wrong, so i have to do it at home. So i downloaded NetBeans IDE 3.5.1 and JCreator. i cant figure out how to put classes into my project here. There we would click on the drop-down menu [PROJECT] and click [import], and put in all the JAR files we need. But i cant seem to figure out how to do that in either JCreator or NetBeans. does anyone know how to do that in either of those programs (perferably JCreator) you can download them at [href]java.sun.com[/href] and [href]jcreator.com[/href] if you dont know but do know JAVA and want to help me figure this out

thanx

ps: i need to get my project working by friday at 3:00pm MST. so i really want to be able to run me JAVA applications by tomarrow night

i also need to be reminded how to do do...while loops
is it:


or am i completly wrong

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Dec 2003 05:47
isn't it...



I don't write in c++, or java (not much)

-RUST-

VB.NET makes me all goose-pimply!
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 16th Dec 2003 06:03 Edited at: 16th Dec 2003 06:04
i actually thought it was

do while(x<9)
{
...
}


but it gives those red swiggly lines under it like they do in MS Word when you spell something wrong. so i figured it was wrong

oh wait, i think i got it:

while (x <9)
{
code;
}

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 16th Dec 2003 06:16 Edited at: 16th Dec 2003 06:22
i actually need to know how to target the class that contains:
public static void main(String[] args)
method (the starting class). also
thanx

im sorry im asking all these stupid questions, im really not that dumb

funny, the AFFILATE banner at the bottom of the screen actually had a whole bunch of links for JAVA tutorials and stuff. oh i get it, it searches my posts and such for what im talking about...i think...if so, thats perty cool

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Dec 2003 15:09
Wouldn't it make sense to ask these questions on a Java web site?!

With our species on the edge of extermination,
with no prospect but a horrible death,
we actually played games.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 16th Dec 2003 15:16 Edited at: 16th Dec 2003 15:18
I've never seen you knock back a PHP question Rich...

Actually now that I think about it there was one in the DBP Discussion forum... but we usually get heaps in here.


"Computers are useless they can only give you answers."
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 16th Dec 2003 18:20
i usually post my questions at another forum when its about programming, but i was just banned for "flamming" (i said 'stupid' whats with that?) and the 3rd forum i goto is currently updating their forum so they temp closed it down.

so if no one knows, i could find somewhere else to post

Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 16th Dec 2003 18:21
You stupid stupid-head.

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 16th Dec 2003 23:58
SOMEONE BAN CHRIS KNOTT!! HE JUST FLAMMED ME!!!
lol
those boards are corrupt any how, stupid and corrupt.

but i still need help, so if anyone knows...

i saw someone here who said once that they knew java. anyone know anyone here who knows JAVA?

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 17th Dec 2003 00:41
btw: does anyone know of a forum that would be better to ask this question at?

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 17th Dec 2003 01:56
HOT DOWG!!!! i figured it out! all i need to know now is how to point it to the starting class (the class with the public static void main(String[] args) method) so if anyone knows...
but i posted this at a JAVA forum, so if no one knows, you dont HAVE to figure it out

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Dec 2003 07:10 Edited at: 17th Dec 2003 07:11
I know java.


There is no DO command in a while loop.

while (x < 3)
{
//do something
}

What do you mean by point to the starting class? None of your other classes should be trying to point to the class with your main() method. Unless you're talking about inner classes accessing the super class. Tell me what you're trying to do in your program.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 17th Dec 2003 07:26 Edited at: 17th Dec 2003 07:28
thanx Phaelax, i already figured out the "while" thingy.

lets see if i can explain this better.
im not trying to point any class to the main method. there is NO code telling anything to go to the main method. what i meant is the starting target. in class we use Code Warior, and in code warior you click on the workspace window, click on the TARGET tab, and then change the target to the starting class.
example:

in the target i would type START, that way, the program knows where to look for the main method. i need to know how to do that in NetBeans IDE 3.5.1 or i will get this error:
Quote: "
java.lang.NoClassDefFoundError: Airplane/Main
Exception in thread "main" 
"


Airplane is the project name, and Main is the file name (i believe)
i'll post a screen shot, see if that helps at all:
http://www.geocities.com/deathlink84095/blah.JPG
(arg, i dont think the image is going to work)
im not quite familier(sp?) with the NetBeans environment at all, so im quite on the confused side on what to do.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Dec 2003 08:18
Hmm, I'm not familiar with code warrior. I use BlueJ, which is free from the java developers themselves. In BlueJ, all you have to do is right-click on the class, and click run main().
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 18th Dec 2003 00:05
well, im not having a problem with Code Warior. its netBeans, i believe that is made by the developers too, because i downloaded it from java.sun.com (sun.java.com?) but i'll try downloading BlueJ, see how that is...

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 18th Dec 2003 08:11
ok i figured out how to do that, but that apparently wasnt my problem.
i get this error
Quote: "java.lang.NoClassDefFoundError: Airplane/Main
Exception in thread "main" "

when i try to run my program.
you know whats wrong Phaelax?(or anyone who knows JAVA)
i really need to know before the end of school friday (3:00 MTS, thats -2hrs from the server time)

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Dec 2003 22:28
can you post your code?
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 19th Dec 2003 00:53 Edited at: 19th Dec 2003 00:55
gladly


i put it in the source box to.

sorry, i havnt commented it that much. i have a bad habbit of waiting to comment

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Dec 2003 11:05
I usually wait til the end to comment too.

Hasn't your teacher taught you naming conventions yet?

Well I broke your code down into 4 seperate class files. Unfortunately, I can't try to run your code because I don't have these: chn.util.*; apcslib.*;


Also, I think your MAIN heading should look like:
public static void main(String args[])

instead of:
public static void main(String[] args)


Actually, I think that might be your only problem. I adjusted everything else so that I could compile it. Everything compiles fine for me now, minus those classes I had to change.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Dec 2003 11:09
Ok nvm, the brackets don't seem to make a difference.

That error usually means that you're trying to create an object of a class that it can't find.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 19th Dec 2003 21:43
i could email you those classes if you want... i dont think the brackets change anything, iv written several programs with it like that

JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Dec 2003 03:32
Quote: "Hasn't your teacher taught you naming conventions yet?"


what are they?

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Dec 2003 08:53
It's the way variables and classes are named. To make it easier to identify what things are in your code from other ppl. Constants should be all capitals. Classes should start with a capital only, not be all capitals. And when you have a variable such as "thisisathing", each new word part should be capital, but not the first part. "thisIsAThing"
This is just what I've been taught. And it's actually helped me figure things out in code other than my own.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 21st Dec 2003 05:53
yeah. he told us that...i just choose to ignore it.

do you know whats wrong tho?

Login to post a reply

Server time is: 2024-11-24 08:24:28
Your offset time is: 2024-11-24 08:24:28