The program ignore the rest of the code..........

hi someone can help me.
*** example main code:
System.out.println("hello 1");
classx.do();
System.out.println("hello 2");
*** result:
the program show "hello 1" only
*** the method do () of classx:
public void do (){
system.out.println("ok");
it seems that the program don't return to the main code.

Thank' for the links.
I reply a simplified code.
*** definition of mainClass I tried
public class mainClass () {
public static void main( String [] args )
IgnoreCode ignorecode = new IgnoreCode ();
classX x = new classX ();
/* associate x to ignorecode to allowe to call the doPrint
method of x object in the doprint method of ignorecode object */
ignorecode.associate(x);
/* associate ignorecode to x to allowe to call the doPrint
method of ignorecode object when ......an event occur in the
swing interface shown by the show method of x object */
x.associate(ignorecode);
x.show (); /* see definition of classX under
*** definition of IgnoreCode class
public class IgnoreCode extends SuperClass
public void doPrint(){
System.out.println( "In do" );
x.doPrint();
System.out.println( "In do" );
*** definition of SuperClass class
public abstract class SuperClass {
protected classX x;
public void associate(classX x1){
x = x1;
*** definition of classX class
public class classX {
protected IgnoreCode ignorecode;
public void doPrint() {
System.out.println( "x In do" );
public void associate( IgnoreCode ignorecode1 ){
ignorecode = ignorecode1;
public void show () {
/* swing interface */
}

Similar Messages

Maybe you are looking for