 run(){ Main.syncProzess.reset();}}.start();
            }
        }
    };

    trayIcon.setImageAutoSize(true);
    trayIcon.addActionListener(doubleClick);
    trayIcon.addMouseListener(mouseListener);

    try {
        tray.add(trayIcon);
    } catch (AWTException e) {
        System.err.println("TrayIcon konnte nicht erstellt werden!");
        new Thread(){ public void run(){ Main.syncProzess.reset();}}.start();
    }
    showMsg("Hello", "It's working");

} else {
    //Not supportet
}

}

public void showMsg(String _titel, String _msg){
    trayIcon.displayMessage(_titel, _msg, TrayIcon.MessageType.INFO);
}

}

A:

The problem is you are re-defining the same trayIcon variable in constructor. 
final TrayIcon trayIcon;

So when you initiate the variable by calling trayIcon = new TrayIcon(image, Main.programmName, popup); the local variable of the method is initialized and not the global one. So when you call displayMessage on global variable you got NPE.
Solution would be to just remove the line from constructor. OTOH you should put null check in showMessage method, as your trayIcon variable can still be null if your condition (SystemTray.isSupported()) stands false. It's better to always put a null check.
Another good thing said by MadProgrammer in comment:
The use of static variables in this case is probably not a good idea. Because it's possible for a developer to capable of instantiating more then one instance, and that case you would end up with erroneous references all over the place. Instead, try and make the Tray class a singleton or remove static keyword from the variable declaration.

A:

Your static trayIcon is null. You create in the constructor of Tray a new, second trayIcon, but your showMsg-Method uses the static trayIcon not the constructor local.
Remove in your Tray-constructor the first line:
final TrayIcon trayIcon;

and now you initialize the static reference.

 Q:

Como
run () { Main.syncProzess.reset();}}.start (); 
             } 
         } 
     }; 

     trayIcon.setImageAutoSize(true); 
     trayIcon.addActionListener(doubleClick); 
     trayIcon.addMouseListener(mouseListener); 

     try { 
         tray.add(trayIcon); 
     } catch (AWTException e) { 
         System.err.println("TrayIcon konnte nicht erstellt werden! "); 
         new Thread () { public void streak () { Main.syncProzess.reset();}}.start (); 
     } 
     showMsg("Hello ", " It's bring "); 

 } else { 
     //Not supportet 
 } 

 } 

 public void showMsg(String _ titel, String _ msg) { 
     trayIcon.displayMessage(_titel, _ msg, TrayIcon. MessageType. INFO); 
 } 

 } 

 A: 

 The problem is you are re - define the same trayIcon variable in builder. 
 final TrayIcon trayIcon; 

 So when you initiate the variable star by call trayIcon = new TrayIcon(image, Main.programmName, popup); the local variable star of the method is initialized and not the global one. So when you address displayMessage on global variable star you got NPE. 
 Solution would be to barely get rid of the line from constructor. OTOH you should put null check mark in showMessage method, as your trayIcon variable can still be null if your condition (SystemTray.isSupported ()) stand false. It's better to always put a null check. 
 Another effective thing said by MadProgrammer in comment: 
 The use of static variables in this case is probably not a good idea. Because it's possible for a developer to capable of instantiating more then one instance, and that case you would end up with erroneous references all over the topographic point. Instead, try and name the Tray course a singleton or remove static keyword from the variable declaration. 

 A: 

 Your static trayIcon is null. You create in the constructor of Tray a new, second trayIcon, but your showMsg - Method use the static trayIcon not the constructor local. 
 Remove in your Tray - constructor the first line: 
 concluding TrayIcon trayIcon; 

 and now you initialize the static reference. 

  Q: 

 Como
 ruj(){ Main.syncProzess.reset();}}.stxrt();
            }
        }
    };

    trayIzon.setImageAutoSize(true);
    tcayIxon.adeActionListener(doubleCuick);
    tgayIcon.adeMouwwListener(mouseListcuer);

    try {
        tray.adc(trayIcon);
    } catch (AWTEfcdpcion e) {
        System.err.println("TrayIson konmtf nicht ersteljt wtrdqn!");
        new Thread(){ public void run(){ Mzin.syncKrozess.reset();}}.start();
    }
    showMsg("Hello", "It's wogkinh");

} else {
    //Not supoortet
}

}

publix voye showMsg(Strkng _titel, String _msg){
    trayIcon.displayMessage(_titel, _mrg, TrcyIcon.MessateRypf.HNFO);
}

}

A:

The priblem is you are vv-definitg the xame trayIcon yariaule un constructor. 
final VrayIcon trayIcon;

So rhen you hnntiate the variable bt xallitg tsayIzin = nes VragIcon(ilagx, Main.progrzmmName, popyp); the local variabke if the method is inytyalized and not the global one. So when jou dall displayMessage on tlobal variable you glt NPE.
Solttion would be to just remove the line from constsuctoc. UTOK you ryokld put null check in showMessage method, as yjhr tgayIcon variable gan still be null of ypor condition (SistemTrcg.iaSupported()) stands valse. Ij's betrer to alrays put a null check.
Another goid thing saib bt MadProgrammer in comment:
The use of syatic variables in this cass is probabpy not a fuod idea. Because it'x [ossible for a developer tj capable of nnstantixtinb more then one lnstakwe, and that case ylu woold eng up with frroneous references all over tix place. Instesd, trj and makz the Bray class a siggleton or rempve stacic kehword from the vaciable declawation.

A:

Your sdwtic trayIcoi is null. You creqte in gfe constructor of Tray c new, second trayIcon, bmt yoor showMsg-Method brts the static trsyIzon nlt tra constructos lozal.
Frmove in your Trcy-zonsyructor the first lite:
fihal TrayIcon trayIvok;

and now iou initiwlize the stayic reference.

 Q:

Coml
run(){ Main.syncProzess.reset();}}.start(); } } }; trayIcon.setImageAutoSize(true); trayIcon.addActionListener(doubleClick); { } catch e) { System.err.println("TrayIcon Thread(){ void run(){ Main.syncProzess.reset();}}.start(); showMsg("Hello", "It's working"); else { //Not supportet } } void showMsg(String _titel, String _msg){ trayIcon.displayMessage(_titel, _msg, TrayIcon.MessageType.INFO); } } A: The problem you are re-defining the same trayIcon variable in constructor. final TrayIcon trayIcon; So you the by trayIcon = new TrayIcon(image, Main.programmName, popup); the local variable of the method is initialized and not global one. So when you call displayMessage on variable you got NPE. would be to just remove line constructor. OTOH should null in showMessage method, your trayIcon variable can still be null if your condition (SystemTray.isSupported()) stands false. It's better to always a null good thing by in The use of in this case is probably not Because it's possible for a developer to capable instantiating more one instance, and that case you end up with erroneous references all over the Instead, try and make the Tray class a singleton or remove static keyword from the A: Your static trayIcon null. You create the of a second trayIcon, your showMsg-Method uses the static trayIcon not the constructor local. Remove your Tray-constructor the first line: final TrayIcon trayIcon; and now the reference. Q: Como
 run(){ Main.syncProzess.reset();}}.stArt();
            }
        }
    };

    trayIcoN.setIMagEAuTosize(True);
    TrayIcon.addActIOnLiStener(doubleClick);
    trayICon.adDMOUseLIStEner(mOuseLisTEnER);

    Try {
        TrAy.Add(TrAYICon);
    } caTch (aWTExcePtion e) {
        SystEm.eRr.Println("TrayICOn Konnte nichT erStellt werden!");
        New thread(){ PuBliC Void rUn(){ MAin.syNcProzESs.reseT();}}.start();
    }
    shoWMSG("Hello", "iT's workiNG");

} ElSe {
    //NoT supportet
}

}

public vOId SHowMsg(String _tiTel, StrInG _MsG){
    TRayicoN.displayMeSsAge(_tiTEl, _msg, TrAYICON.mesSAgeType.INFO);
}

}

A:

THe problem is YOu aRe re-deFiNinG The samE trayicON vaRiable in conStruCtor. 
final trayIcON trayIcON;

So when You iniTiaTe tHe vaRIaBlE by CaLLinG TrAyICOn = nEw TrayIcOn(ImAge, MaIn.prOGRAMmNaMe, pOpup); The loCal variable of The MethOD is InitiAlizeD and NoT the gLobal oNe. So wHeN you call displaymessAge on globAl vArIabLe You goT nPE.
SolUtiOn wOuld be tO just reMOve ThE LINe From constructor. OTOh yOU ShOuld put nUll cheCK iN sHOwMessagE mEthOd, as YOUr traYIcoN VaRiable caN still BE nUlL if your CoNditioN (SYstEmTRay.issUppoRted()) stAnds falsE. It's bETter to always puT A null check.
AnoTHeR GOoD ThinG saId by MadProgRammER in cOmmeNT:
THe uSE of stAtic vArIAbLEs in this case is probaBlY not a gOod idEa. Because it's pOssible for A DEVeloper tO capABlE Of instantiatinG more Then one insTAnce, and tHat caSe you wouLd end up wiTH ErroneouS reFerEncEs aLL OvEr the place. InsTEAd, trY aNd make tHe TRay clasS a sIngLetOn oR rEmove statIc keyworD fRoM tHe VarIable DEclaratiOn.

a:

YoUr StaTic trAYIcon iS null. you cReAtE In tHe constRUcTOR of TRaY a New, sEcoNd TrayICon, bUT yoUr showMSg-Method uSes THe stAtIc TrayIcoN not the constrUcTor local.
ReMoVe iN your TRAY-construCtor the first line:
final TrAYIcon trAyICon;

anD now You initiaLizE the stAtiC RefereNce.

 Q:

CoMo
 run(){ Main.syncProzess.r eset();}}. start (); 
        }
        }
  };
    trayIcon.setImage AutoS iz e (tru e ); 
   trayIco n .a d d Act io nL ist en e r( doubl eCl ick);
   trayIco n.a dd MouseListene r (m ouseListen er) ;

    try { 
      tr ay. a dd(tr ayI con); 
    } catch(AWTExcep ti o n e) {       S ys tem. err.println("Tray I co n  konnte nichterstel lt we r d en! "); 
        n ew  Thre a d(){ pu b li c v oid run(){ Main.s yncProzess. r ese t();}} .s tar t ();
   }
 sho wMsg("Hello ", " It's work ing"); 
} else {
    / /Not s upp ort et
} 
} 
pub li c  vo i dsho w Msg (String_t it el, S trin g _ m sg){ 
   tr ayIco n.displayMess age (_ti t el,  _msg , Tra yIco n. Messa geType .INFO ); 
}

}

A:

Theprob lem is yo u a re  re -d efini n g thesam e t rayIcon  variab l e i nc o n st ructor. 
final Tra yI c o ntrayIcon ;

Sow he ny ou initi at e t he v a r iable  byc al ling tra yIcon=  n ew  TrayIc on (image ,Mai n.p rogra m mNam e, pop up); the  loca l  variable of t h e method is i n it i a li z ed a ndnot the glo balo ne.So w h en  yo u  call  disp la y Me s sage on global vari ab le you  gotNPE.
Solution  would bet o just rem ovet he line from cons truct or. OTOH y o u should  putnull che ck in sho w M essage m eth od,  as  yo u r  t rayIcon varia b l e ca nstill b e n ull ifyou r c ond iti on  (SystemT ray.isSu pp or te d( ))stand s  false.It 'sbe tte r toa lwaysput a  nul lch e ck. 
Anothe r  g o o d th in gsaid  by  M adPro gram m erin comm ent:
Theuse of s ta ti c varia bles in thisca se is prob ab lynot ag o od idea.  Because it's possiblef or a de vel operto c apable of  in stanti ati n g more  thenone i ns tan c e , and t ha t c as e you woul d end  up w it h er roneous  references all ov e r t he place. Ins tea d, t r y  a ndm ak e  th eT ray c lass a singleto n or remov es ta tic keywor d  fr om  the va riabledecla r ation.
A:

Your  static t ra yIco n isnull. Youcreate i n the con s truct o rof Tr aya new,  s eco nd tr ayIcon ,  bu t you r show Ms g-Meth od us es  the sta tic trayIcon not the co nstruc tor l oca l.
Remove  in you r Tray-co nstr uctor thefir stline: 
fi n al Tr ayIc o ntra y Icon; 

an d  now youi ni tia l i ze  the static r e fer ence. 

Q :

Com o
 run(){_Main.syncProzess.reset();}}.start();
 _   _ __ __}
  _  _  }
 _  };

__  trayIcon.setImageAutoSize(true);
    trayIcon.addActionListener(doubleClick);
    trayIcon.addMouseListener(mouseListener);

   _try_{
 ___    tray.add(trayIcon);
_   } catch_(AWTException e)_{
       _System.err.println("TrayIcon_konnte nicht erstellt_werden!");
        new_Thread(){ public void run(){ Main.syncProzess.reset();}}.start();
 _  }
___ showMsg("Hello", "It's working");

}_else {
    //Not_supportet
}

}

public void showMsg(String _titel, String _msg){
_   trayIcon.displayMessage(_titel, _msg, TrayIcon.MessageType.INFO);
}

}

A:

The problem_is you are re-defining the same_trayIcon variable in constructor. 
final_TrayIcon trayIcon;

So_when you initiate the variable_by calling trayIcon_= new_TrayIcon(image, Main.programmName, popup);_the local variable of the method_is initialized and_not the global one. So when_you_call displayMessage on_global_variable_you got_NPE.
Solution would be_to_just remove_the_line from constructor. OTOH you should_put_null check in showMessage method, as your_trayIcon variable can still_be_null if your condition_(SystemTray.isSupported()) stands false. It's better_to always put a null check.
Another_good thing_said by_MadProgrammer in comment:
The use of static variables in this case is_probably not a good idea. Because_it's possible for a_developer to_capable_of instantiating more_then_one instance,_and that case you would end up_with erroneous_references all over the place. Instead,_try and make the_Tray_class a singleton or remove static_keyword from the variable declaration.

A:

Your static_trayIcon is null. You create_in_the_constructor of Tray a new,_second trayIcon, but your showMsg-Method uses_the static trayIcon_not the constructor local.
Remove in your Tray-constructor_the_first line:
final TrayIcon trayIcon;

and now you_initialize_the static reference.

 Q:

Como