home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / J A V A / Java Development Kit V1.2 / jdk12-win32(1).exe / data1.cab / demos / demo / jfc / Metalworks / MetalworksInBox.java < prev    next >
Encoding:
Java Source  |  1998-12-01  |  3.0 KB  |  89 lines

  1. /*
  2.  * @(#)MetalworksInBox.java    1.3 98/08/26
  3.  *
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. import java.awt.*;
  16. import java.awt.event.*;
  17. import java.util.*;
  18. import javax.swing.*;
  19. import javax.swing.border.*;
  20. import javax.swing.tree.*;
  21.  
  22.  
  23. /**
  24.   * This is a subclass of JInternalFrame which displays a tree.
  25.   *
  26.   * @version 1.3 08/26/98
  27.   * @author Steve Wilson
  28.   */
  29. public class MetalworksInBox extends JInternalFrame {
  30.   
  31.     public MetalworksInBox() {
  32.     super("In Box", true, true, true, true);
  33.  
  34.     DefaultMutableTreeNode unread;
  35.     DefaultMutableTreeNode personal;
  36.     DefaultMutableTreeNode business;
  37.     DefaultMutableTreeNode spam;    
  38.  
  39.         DefaultMutableTreeNode top = new DefaultMutableTreeNode("Mail Boxes");
  40.  
  41.     top.add( unread = new DefaultMutableTreeNode("Unread Mail") );
  42.     top.add( personal = new DefaultMutableTreeNode("Personal") );
  43.     top.add( business = new DefaultMutableTreeNode("Business") );
  44.     top.add( spam = new DefaultMutableTreeNode("Spam") );
  45.  
  46.     unread.add( new DefaultMutableTreeNode("Buy Stuff Now") );
  47.     unread.add( new DefaultMutableTreeNode("Read Me Now") );
  48.     unread.add( new DefaultMutableTreeNode("Hot Offer") );
  49.     unread.add( new DefaultMutableTreeNode("Re: Re: Thank You") );
  50.     unread.add( new DefaultMutableTreeNode("Fwd: Good Joke") );
  51.  
  52.     personal.add( new DefaultMutableTreeNode("Hi") );
  53.     personal.add( new DefaultMutableTreeNode("Good to hear from you") );
  54.     personal.add( new DefaultMutableTreeNode("Re: Thank You") );
  55.  
  56.     business.add( new DefaultMutableTreeNode("Thanks for your order") );
  57.     business.add( new DefaultMutableTreeNode("Price Quote") );
  58.     business.add( new DefaultMutableTreeNode("Here is the invoice") );
  59.     business.add( new DefaultMutableTreeNode("Project Metal: delivered on time") );
  60.     business.add( new DefaultMutableTreeNode("Your salary raise approved") );
  61.  
  62.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  63.     spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
  64.     spam.add( new DefaultMutableTreeNode("HOT HOT HOT") );
  65.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  66.     spam.add( new DefaultMutableTreeNode("Don't Miss This") );
  67.     spam.add( new DefaultMutableTreeNode("Opportunity in Precious Metals") );
  68.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  69.     spam.add( new DefaultMutableTreeNode("Last Chance") );
  70.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  71.     spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
  72.     spam.add( new DefaultMutableTreeNode("To Hot To Handle") );
  73.     spam.add( new DefaultMutableTreeNode("I'm waiting for your call") );
  74.  
  75.     JTree tree = new JTree(top);
  76.     JScrollPane treeScroller = new JScrollPane(tree);
  77.     treeScroller.setBackground(tree.getBackground());
  78.     setContentPane(treeScroller);
  79.     setSize( 325, 200);
  80.     setLocation( 75, 75);
  81.  
  82.     }
  83.  
  84.  
  85.  
  86. }
  87.  
  88.  
  89.