In your program, need to replace below condition :
if(f==1)
target.replaceSelection( "\n\t");
with this code:
if(f==1)
{
target.replaceSelection( "\n");
target.replaceSelection("\t //write your code");
target.replaceSelection( "\n");
target.replaceSelection("}");
f=0;
}
Compile and run the program the out put will be :
Quote:
Method{
//write your code
}
This is only a sample code. Hope it helps you.
Regards,
Panduranga.