Hi avinsinanan -
There's a program that already does this; it's called the BeanBox, it's free, and it comes with source code. It's part of the Beans Development Kit which you can
download from here. Play with it; you'll see the functionality you're interested in, then you can look through the source to see how they did it. Happy hunting!
When you come back, could you please register with a first and last name? JavaRanch wants to maintain a professional looking site, and participants can help us do that by using their proper name as a login handle. Thanks!
------------------
Michael Ernest, co-author of:
The Complete Java 2 Certification Study Guide