/[classpath]/classpath/examples/gnu/classpath/examples/swing/Demo.java
ViewVC logotype

Diff of /classpath/examples/gnu/classpath/examples/swing/Demo.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.7 by gnu_andrew, Sun Aug 7 18:34:09 2005 UTC revision 1.1.2.8 by gnu_andrew, Sat Sep 10 15:31:35 2005 UTC
# Line 141  public class Demo Line 141  public class Demo
141      preferences.add(new JCheckBoxMenuItem("Check Spelling",      preferences.add(new JCheckBoxMenuItem("Check Spelling",
142                      stockIcon("spell-check")));                      stockIcon("spell-check")));
143      preferences.add(new JCheckBoxMenuItem("World Peace"));      preferences.add(new JCheckBoxMenuItem("World Peace"));
144        preferences.add(new JSeparator());
145        preferences.add(new JRadioButtonMenuItem("Radio Button"));
146      edit.add(preferences);      edit.add(preferences);
147    
148      JMenu examples = new JMenu("Examples");      JMenu examples = new JMenu("Examples");
# Line 493  public class Demo Line 495  public class Demo
495    
496      final JTree tree = new JTree(root);      final JTree tree = new JTree(root);
497      tree.setLargeModel(true);      tree.setLargeModel(true);
498        tree.setEditable(true);
499      DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();      DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();
500      dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);      dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
501      tree.setSelectionModel(dtsm);      tree.setSelectionModel(dtsm);
# Line 640  public class Demo Line 643  public class Demo
643      return panel;      return panel;
644    }    }
645    
646      static JPanel mkTabWorld()
647      {
648        JPanel panel = new JPanel(new GridLayout(2, 2));
649        panel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
650        JTabbedPane tabs1 = new JTabbedPane(SwingConstants.TOP);
651        tabs1.add("Top Item 1", new JButton("Button"));
652        tabs1.add("Top Item 2", new JButton("Button"));
653        JTabbedPane tabs2 = new JTabbedPane(SwingConstants.LEFT);
654        tabs2.add("Left Item 1", new JButton("Button"));
655        tabs2.add("Left Item 2", new JButton("Button"));
656        JTabbedPane tabs3 = new JTabbedPane(SwingConstants.BOTTOM);
657        tabs3.add("Bottom Item 1", new JButton("Button"));
658        tabs3.add("Bottom Item 2", new JButton("Button"));
659        JTabbedPane tabs4 = new JTabbedPane(SwingConstants.RIGHT);
660        tabs4.add("Right Item 1", new JButton("Button"));
661        tabs4.add("Right Item 2", new JButton("Button"));
662        panel.add(tabs1);
663        panel.add(tabs2);
664        panel.add(tabs3);
665        panel.add(tabs4);
666        return panel;        
667      }
668    
669    static JTabbedPane mkTabbedPane()    static JTabbedPane mkTabbedPane()
670    {    {
671      JTabbedPane tabs = new JTabbedPane();      JTabbedPane tabs = new JTabbedPane();
# Line 648  public class Demo Line 674  public class Demo
674      tabs.add("List world!", mkListWorld());      tabs.add("List world!", mkListWorld());
675      tabs.add("Desktop world!", mkDesktopWorld());      tabs.add("Desktop world!", mkDesktopWorld());
676      tabs.add("Tree world!", mkTreeWorld());      tabs.add("Tree world!", mkTreeWorld());
677        tabs.add("Tab world!", mkTabWorld());
678      return tabs;      return tabs;
679    }    }
680    

Legend:
Removed from v.1.1.2.7  
changed lines
  Added in v.1.1.2.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26