I got this sample from JavaPassion site.It's great one for beginners
it's very good sample about getting current Threads information...