How to set my status when i login ....?check my code plzzzz

i want change my status to mode to (away,busy,available…etc) … how to do this when i login using my progrom

i am using smack…

class connect{

Collection entries;

XMPPConnection con;

ConnectionConfiguration config ;

Roster addlist;

public void conestablish(){

try{

config = new ConnectionConfiguration (“talk.google.com”,5222,“gmail.com”);

config.setCompressionEnabled(true);

config.setSASLAuthenticationEnabled(false);

con = new XMPPConnection(config);

con.connect(); /* Connect to the XMPP server */

con.login(“user”,“password”);

Thread.sleep(2000);

Presence pre=new Presence(Presence.Type.available);// this is not working

pre.setMode(Presence.Mode.away); //it show available always…

}

catch(Exception e){

}

}

}

plzzz help

thanks in advance

ok i got it…this is how i done…

Presence presence = new Presence(Presence.Type.available);

presence.setStatus(“this code is working…”);

presence.setPriority(24);

presence.setMode(Presence.Mode.away);

con.sendPacket(presence);