![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
First off Ill say this is a Uni Assignment, ive pretty much finished the assignment, only I keep getting Null Pointer Exceptions and its driving me crazy, the reason I say I need urgent help is that the assignment is due in in 10 hours, we were give 2 weeks to do it and I wont let all this work go to waste because of a stupid null pointer.
The assignment is basically to make a media management system for Photos, Sound Bites and Video Clips. The media classes are all inherited from one class called MediaItem, there is a CatalogueArray (note: CatalogueArray NOT Catalogue) class which has all the add and delete functions, and also main class called MediaGui, there are also some other classes that arent used for anyhting yet. Basically as youll se fom running the program, when you try to "Save" a media item, after filling in all the correct details, you will get a null pointer error, you will also get one when you load a library in and a few other things, I am having a huge time trying to sort this out and just cant do it, im hoping that a fresh set of eyes will spot it straight away. I dont hold many high hopes for getting this done in time as it is very short notice, but if anyone can help me id be so unbelievably greatful. I exported my whole project from eclipse into a file system and have uploaded it to my web space - http://www.dark-designs.co.uk/downlo...mentSystem.zip |
|
|
|
|
|
#2 | |
|
Programmer
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4
![]() |
Quote:
__________________
#if 0 /* in case someone actually tries to compile this */ <Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode? |
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
Maybe i'm just not seeing it, but in your CatalogueArray do you ever initialize numberOfMediaItems. Cause you keep comparing it but i can't see where you initialize it. Also the private MediaItem [ ] mediaItems;.
I'm probably waaay off ![]()
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#4 |
|
Programmer
|
OK initialising numberOfMediaItems to 0 seems to of fixed some things, now when I load a library file in I ge this Null Pointer:
java.lang.NullPointerException at mediaManagementSystem.CatalogueArray.displayAll(CatalogueArray.java:433) at mediaManagementSystem.MediaGui$18.actionPerformed(MediaGui.java:556) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) |
|
|
|
|
|
#5 |
|
Professional Programmer
|
private MediaItem [ ] mediaItems = new MediaItem[200];
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
#6 | |
|
Programmer
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4
![]() |
Quote:
__________________
#if 0 /* in case someone actually tries to compile this */ <Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode? |
|
|
|
|
|
|
#7 |
|
Programmer
|
Sorry, im not that great with Java as you may have noticed, how to I check everything is initialized
|
|
|
|
|
|
#8 | |
|
Professional Programmer
|
Quote:
Also i have a question :public String displaySound() {
String result = "If you can read this, some things gone wrong. Bugger.";
int i = 0;
numberOfMediaItems = 10;
if (numberOfMediaItems < 1)
{
return "The Media library is empty";
}will it ever return "The Media library is empty";
__________________
Don't take life too seriously, it's not permanent ! |
|
|
|
|
|
|
#9 | |
|
Programmer
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4
![]() |
Quote:
__________________
#if 0 /* in case someone actually tries to compile this */ <Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode? |
|
|
|
|
|
|
#10 | ||
|
Programmer
|
Quote:
Oh yea the "numberOfMediaItems = 10;" was me testing stuff, ive removed it now. Quote:
|
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|