Help Wanted

Java programmers – vincent

vincent

Member

Posts: 129
From: Amersfoort, the Netherlands
Registered: 12-23-2002
I didn't mean to spam the board, but could I someone give me some idea of how many Java programmers there are here? and who do have an hour or two a week to spare?
CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
No time to spare (working on my own project), but I do program Java.
Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
I am doing my game in Java I'm pretty much a newby though. I also don't have much time as I'm trying to make a drive to a first playable.

Love in Christ
Gift.

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Of course I wouldn't mind some java help my self. Does anybody know how to do the mouse listener stuf??

Love in Christ
Gift

vincent

Member

Posts: 129
From: Amersfoort, the Netherlands
Registered: 12-23-2002
Mouselistener is easy. Java.sun.com always has a lot of tutorials.

http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html
http://java.sun.com/docs/books/tutorial/uiswing/events/mousemotionlistener.html

Good luck,
Vincent

Destroyer

Member

Posts: 31
From: Bismarck, ND
Registered: 10-06-2002
Iv been learning java in school and have been getting into some more advandced things lately, i don't know how advanced you want, but i probably don tknow it now but the class is AP so it is fast paced so i should be pretty profiecient by the end of the semester
GUMP

Member

Posts: 1335
From: Melbourne, FL USA
Registered: 11-09-2002
Heylo, just finished a 2 year project using Java.
Imsold4christ

Member

Posts: 305
From: Gresham, OR, US
Registered: 01-20-2001
I do java, but most of the time I'm too busy to be of much help. Now is one of those times.

†Caleb†

------------------
"True friendship is not characterized by the absence of conflict, but by the ability to resolve conflict."

Christian
Member

Posts: 400
From: Australia
Registered: 09-15-2002
Just now learning J2EE, to compliment my C#/ASP.NET skills.
Wacko4X

Member

Posts: 92
From: Bellvue, WA, USA
Registered: 08-21-2002
I would like to help but I am just learning java at school.... Hey if you guys know of any really good tutorials or books that would be great cause I do want to become a programmer!
Wacko

------------------
Hebrews 12:28-29 NIV
"Therefore, since we are receiving a kingdom that cannot be shaken, let us be thankful, and so worship God acceptably with reverance and awe, for our 'God is a consuming fire.'"

Matthew 11:18-19 NIV
"For John came neither eating nor drinking, and they say, 'He has a demon.' The Son of Man came eating and drinking, and they say, 'Here is a glutton and a drunkard, a friend of tax collectors and "sinners."' But wisdom is proved right by her actions."

Every man has a battle to fight, an adventure to live and a beauty to rescue. ~John Eldrige

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
I got a pretty good book called "Black Art of Java Game Programming" and a book called "Game Arcitecture and Design" and also read alot of stuf on www.gamedev.net and www.gamasutra.com

Love in Christ
Gift

logk34
Junior Member

Posts: 1
From: Morris, MN, USA
Registered: 02-16-2003
I'm learning Java in college at the moment. I have been searching the web for some open source opportunites that would allow me to help out the Christian community with some usable software. Does anyone know any good projects that might need some help? If not we should try to come up with some good ideas that would be helpful.

God Bless,

Kevin

Destroyer

Member

Posts: 31
From: Bismarck, ND
Registered: 10-06-2002
well depending on how far into it you are, my teacher puts all his stuff online so you could try some of the programs no cource for them ovbiously but they are fun to see what you can do

http://www.bhs.bismarck.k12.nd.us/madler/apcs/

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Hi Guys,
I'm working on a Christian Video Game Applet, I don't have much experience with Java so I'm having a few minor diffuclties.

1. I am getting some sort of exception thingy poping up in my console,
would that go away if I did a catch exception thingy?

2. I'm trying to draw a string onto my graphics buffer and it has some major issues and is spitting out all sorts of exceptions, would a catch exceptions thingy work here too?

Well just talking about it I have a few ideas, I would like to hear yours, if you would like to help out or what ever I wouldn't mind talking about it. I'm really trying to get something playable by CGDC.

Destroyer

Member

Posts: 31
From: Bismarck, ND
Registered: 10-06-2002
import java.io.*;
public class *class name*
{
public static void main(String args[]) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader (System.in));
Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
I found out that it was a java.lang.NullPointerException I think it means that the object that I'm trying to talk to is null, I don't know why. I'll have to work more on this tomarrow. Thanks for the help.

Love in Christ
Gift

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
quote:

1. I am getting some sort of exception thingy poping up in my console,
would that go away if I did a catch exception thingy?

2. I'm trying to draw a string onto my graphics buffer and it has some major issues and is spitting out all sorts of exceptions, would a catch exceptions thingy work here too?


Java should tell you which line is generating the exception. Sounds like you're trying to access something that doesn't exist.

Telling us what kind of Exceptions you are getting might help. Source code, if you're willing.

Possibilities:

-You might be trying to create an object, but it isn't being created - check to make sure everything you create with "new" is actually being created.

-You might be trying to access something before it's created. Make sure what you're trying to access was actually created somewhere in the program.

(rant)

Making main rethrow the exception - not good idea destroyer. This would be better:


try
{ BufferedReader reader = new BufferedReader(new InputStreamReader (System.in));
} catch (IOException e)
{ // Handle exception here

}

I also find it weird that destroyer's suggesting hooking a BufferedReader directly to System.in - I've never had to do that.

Then again, I've never written a gaming keyboard routine for Java. I imagine that one would look for a way to detect keys going up and down, so the game can handle simultaneous keystrokes.

A KeyListener listening for keyPressed and keyReleased would probably be better for a game.

(/rant)

Gift, make sure whatever you are trying to access exists!


MyObject myObject;

won't create an object!


MyObject myObject = new MyObject(myArguments);

will create an object. My guess is that somewhere you forgot a "new" statement.

Unfortunately, I don't have enough information to make anything better than an educated guess :/.

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Hi Guys,
Thanks for the help.
I wouldn't mind emailing you guys the source.
If you wanted to take a look at it.

its giving the exception at this statement:
((x>(RegionArray[i].xpos-5))&(y>(RegionArray[i].ypos-5)))&((x<(RegionArray[i].xpos+5))&(y<(RegionArray[i].ypos+5)))

It looks like I have did all of those new statements but its definatly not acting like it.

The constructer looks like this:
int ActiveRegion;
Region RegionArray[];

// constructer
public void RegionSovereign() {
// this would load mostly UI stuff basicly all stuff
// that is not game state spisific

RegionArray = new Region[21];

RegionArray[0] = new Region(184,88,"Tarsus");
RegionArray[1] = new Region(67,221,"Salamis");
RegionArray[2] = new Region(272,140,"Antioch");
RegionArray[3] = new Region(254,152,"Seleucia");
RegionArray[4] = new Region(324,177,"Hamath");
RegionArray[5] = new Region(254,204,"Byblos");
RegionArray[6] = new Region(350,226,"Damascus");
RegionArray[7] = new Region(264,242,"Sidon");
RegionArray[8] = new Region(266,276,"Tyre");
RegionArray[9] = new Region(327,260,"Caesarea Philippi");
RegionArray[10] = new Region(249,310,"Ptolemais");
RegionArray[11] = new Region(313,334,"Capernaum");
RegionArray[12] = new Region(291,346,"Nazareth");
RegionArray[13] = new Region(267,370,"Samaria");
RegionArray[14] = new Region(234,364,"Caesarea");
RegionArray[15] = new Region(246,404,"Joppa");
RegionArray[16] = new Region(269,416,"Emmaus");
RegionArray[17] = new Region(292,414,"Jerusaleam");
RegionArray[18] = new Region(275,438,"Bethlehem");
RegionArray[19] = new Region(245,454,"Gaza");
RegionArray[20] = new Region(37,549,"Memphis");

this.ActiveRegion = 17;
}

If you guys have any more questions feal free to ask.

Love in Christ
Gift

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Wait a sec . . .

Shouldn't the line

 Region RegionArray[];
be
 Region[] RegionArray;
?? That's it! Your code is trying to create an array of RegionArray's, when it should be creating an array of Region's!

Silly me, and I almost posted a reply about figuring out whether i was going out of bounds, and how to make sure the new statements were indeed allocating memory . Guess I didn't need to.

BTW, I prefer to put lists like this in a file for easy editing - hardcoding this stuff will make the program less flexible, especially if you plan on adding more regions in the future.

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Don't feel bad about it, BTW - I've had times where I've gone almost crazy trying to find a showstopper bug, only to find I've missssspelled something .

Having a team - or at least having somebody review your code - really helps.

God be with you and your project .

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Hi,
Thanks, that might have been a problem but the behavior is still the same. And I also decrimented the 'i' variable one and that didn't didn't change things either. This might take awhile to solve.

Love in Christ
Gift

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
OK, try this:


try
{
// Put code that throws exception here
} catch (Exception e)
{
System.out.println(e.toString());
}

and post the results from the Java console or terminal on this board.

If I can't figure it out then, I guess you'll have to email the source code. My email address is jeremiah_moss@cobraa1.com .

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001

Here's your mod:

public void handleMapUI(int x,int y) {
for (int i=0; i<20; i++) {

try{ // Put code that throws exception here
if (((x>(RegionArray[i].xpos-5))&(y>(RegionArray[i].ypos-5)))&((x<(RegionArray[i].xpos+5))&(y<(RegionArray[i].ypos+5)))) {
ActiveRegion = i;

}
} catch (Exception e){ System.out.println(e.toString());}
}

// stuff
}

Here's the output:
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException
java.lang.NullPointerException

It looks like it was probably thrown 20 times.
Here's the output I normally get:

java.lang.NullPointerException
at RegionSovereign.handleMapUI(RegionSovereign.java:72)
at GameSovereign.mouseDown(GameSovereign.java:300)
at java.awt.Component.handleEvent(Component.java:5246)
at java.awt.Component.postEvent(Component.java:3807)
at java.awt.Component.dispatchEventImpl(Component.java:3543)
at java.awt.Container.dispatchEventImpl(Container.java:1582)
at java.awt.Component.dispatchEvent(Component.java:3368)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

Line 72 is the if statement.
Its got me beat.

Love in Christ
Gift

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Well, it's time to figure out exactly which variable(s) are null.

Take out my try{} block, and place this code before the for loop:


if(x==null)
{ System.out.println("x is null");
}
if(y==null)
{ System.out.println("y is null");
}
if(RegionArray==null)
{ System.out.println("RegionArray is null");
}
if(RegionArray[1]==null)
{ System.out.println("RegionArray[1] is null");
}
if(RegionArray[1].xpos==null)
{ System.out.println("RegionArray[1].xpos is null");
}
if(RegionArray[1].ypos==null)
{ System.out.println("RegionArray[1].ypos is null");
}

This should tell us if there's something that hasn't been created yet. We'll slay this bug eventually.

On a side note, that should be


for (int i=0; i<=20; i++)

- but we shouldn't do that modification until after we've squashed the bug.
Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Were making progress,

RegionArray is null

I make the Region Sovereign in my main sorta like this:
RS = new RegionSovereign(); // init region sovereign


The region class and constructor looks sorta like this:

public class RegionSovereign {

// variables

int ActiveRegion;
Region[] RegionArray;

// constructer
public void RegionSovereign() {
// this would load mostly UI stuff basicly all stuff
// that is not game state spisific

RegionArray = new Region[21];

RegionArray[0] = new Region(184,88,"Tarsus");

the rest has been previously published.

Hope this helps in finding the bug.

Love in Christ
Gift

CobraA1

Member

Posts: 926
From: MN
Registered: 02-19-2001
Is handleMapUI inside the class RegionSovereign??

Check the scope of RegionArray, make sure handleMapUI can see it!

If that's not the problem, E-mail me the code. It's hard to diagnose the problem from here.

BenjaminBenz

Member

Posts: 15
From: timbuctu, Alberta, Canada
Registered: 12-22-2002
I do Java as my main programming. However my main programming isn't the top of the line stuff that you'd probably want. What wouldja have in mind exactly?:)

------------------
:-)Boss Benz:-)

Gift
Member

Posts: 85
From: Palatine, IL, USA
Registered: 02-11-2001
Woo Hoo, I solved my bug, if you look above you can see that my constructor was declaired void. That is really wrong and probably explains why I was getting a null pointer exception.

My game will be a pretty basic 2D game. I'm trying to build the UI far enough to get the game play and the features far enough to convince some people that its a worthwhile ministrey, people need to catch the vision, to get some people to help make everything better.

Love in Christ
Gift