Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExeption
Trying to read a .xml file, and return the findings. My app already writes to the .xml file. The error I get is 'Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException.
The code in my action performed method calls the ReadEntry method:
elseif( e.getSource( ) == ReminderViewSearch ){
ReadEntry( doc.getDocumentElement( ) );
}
The ReadEntry method is this:publicboolean ReadEntry( Node node ){
String a = ReminderViewYearTxt.getText( );
String b = ReminderViewMonthTxt.getText( );
String c = ReminderViewDayTxt.getText( );
node = getYear( node );
if( node ==null )returnfalse;
node = getMonth( node );
if( node ==null )returnfalse;
node = getDay( node );
if( node ==null )returnfalse;
node = node.getFirstChild( );
while( node !=null ){
//ReminderViewResult.setText( node.getNodeValue( ).trim( ) );
//ReminderViewResult.setText( node.getAttributes( ).item( 0 ).getNodeValue( ) );
System.out.println(node.getNodeValue().trim());
node = node.getNextSibling( );
}
returntrue;
}
And the GetYear method looks like this:private Node getYear( Node node ){
node = node.getFirstChild( );
while( node !=null ){
if( node.getNodeName( ).equals("Year" ) && ( node.getAttributes( ).item( 0 ).getNodeValue( ).equals( a ) ) )
return node;
node = node.getNextSibling( );
}
returnnull;
}
The GetMonth and GetDay methods are the same as the GetYear method, just with different variables.
Any help would be much appreciated. Cheers.

