Sams Teach Yourself J2EE™ in 21 Days, Second Edition
by Martin Bond, Dan Haywood, Debbie Law, Andy Longshaw, Peter Roxburgh
Exercise
Today the JNDITree.java program in Listing 3.3 has shown you how to display a JNDI namespace. Today's exercise is to write a GUI version of this program using the Swing JTree class. If you already know Swing, you can use JNDITree.java as a guide for your program and go ahead and write your own JNDI browser.
If you do not know Swing, the exercise directory for Day 3 on the accompanying Web site includes a template program called JNDIBrowser.java for you to enhance. The JNDIBrowser program handles all of the Swing initialization, all you have to do is get a list of the names in the JNDI namespace and create a new javax.swing.tree.DefaultMutableTreeNode representing each name and add this to the JTree. When you add a name that is also a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access