Package java.awt

Examples of java.awt.CardLayout


*
* @return a dummy blank panel
*/
protected JPanel editPanel() {
    cardPanel = new JPanel();
    cardPanel.setLayout(new CardLayout(HORIZ_GAP, VERT_GAP));

    // Panels are created and added as they are needed. We start with
    // a dummy blank one.
    JPanel panel = new JPanel();
    panel.setPreferredSize(new Dimension(EDIT_PANEL_WIDTH, EDIT_PANEL_HEIGHT));
View Full Code Here


  inq = Inquisitor.create(selectedParameter);
  createdInquisitors.put(selectedParameter, inq);
  cardPanel.add(inq.getPanel(), inq.getPanelName());
    }

    CardLayout cardLayout = (CardLayout)cardPanel.getLayout();
    cardLayout.show(cardPanel, inq.getPanelName());

    // Fill card
    inq.copyParamIntoGUI();
}
View Full Code Here

/**
* Displays the swing page, building it first if necessary.
*/
void showPage() {
    getPage();      // Make sure page completely built
    CardLayout cardLayout = (CardLayout)parent.getLayout();
    cardLayout.show(parent, "page " + pageNumber);
}
View Full Code Here

*/
void forgetPage() {
    if (!isPageBuilt())
  return;

    CardLayout cardLayout = (CardLayout)parent.getLayout();
    cardLayout.removeLayoutComponent(page);
    parent.remove(page);

    page = null;
}
View Full Code Here

  public JWizard(Wizard widget) {
    this.widget = widget;
    pages = new ArrayList();
    listeners = new ArrayList();
    layout = new CardLayout();
    pagesByName = new HashMap();
    componentPanel = new JPanel();
    componentPanel.setLayout(layout);

    JPanel buttonPanel = new JPanel();
View Full Code Here

    final JPanel enumerationEditor = createEnumerationEditor();
    final JPanel textEditor = createTextEditor();
    final JPanel classEditor = createClassEditor();

    detailManagerPanel = new JPanel();
    detailManager = new CardLayout();
    detailManagerPanel.setLayout(detailManager);
    detailManagerPanel.add(classEditor, ConfigDescriptionEditor.CLASS_DETAIL_EDITOR_NAME);
    detailManagerPanel.add(textEditor, ConfigDescriptionEditor.TEXT_DETAIL_EDITOR_NAME);
    detailManagerPanel.add(enumerationEditor, ConfigDescriptionEditor.ENUM_DETAIL_EDITOR_NAME);
View Full Code Here

        JComboBox cb = new JComboBox(comboBoxItems);
        cb.setEditable(false);
        cb.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent evt) {
                CardLayout cl = (CardLayout) (cards.getLayout());
                String active = (String) evt.getItem();
                cl.show(cards, active);
                setActiveGeneratorLoader(active);
            }
        });
        // Put the JComboBox in a JPanel to get a nicer look.
        JPanel comboBoxPane = new JPanel(); // use FlowLayout
View Full Code Here

      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
View Full Code Here

      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
View Full Code Here

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(upper, BorderLayout.CENTER);
    getContentPane().add(lower, BorderLayout.SOUTH);

    final CardLayout cardLayout = new CardLayout();
    main.setLayout(cardLayout);

    // ----------------------------------------------------------------
    // Add tabs to tabbed here. Remember, tabs must implement PrefsTab.
    // ----------------------------------------------------------------
    ArrayList<PrefsTab> tabs = new ArrayList<PrefsTab>();
    tabs.add(new GeneralTab(frame, prefs));
        tabs.add(new FileTab(frame, prefs));
        tabs.add(new EntryEditorPrefsTab(frame, prefs));
        tabs.add(new GroupsPrefsTab(prefs));
    tabs.add(new AppearancePrefsTab(prefs));
    tabs.add(new ExternalTab(frame, this, prefs, parent.helpDiag));
    tabs.add(new TablePrefsTab(prefs, parent));
    tabs.add(new TableColumnsTab(prefs, parent));
    tabs.add(new TabLabelPattern(prefs, parent.helpDiag));
    tabs.add(new PreviewPrefsTab(prefs));
    tabs.add(new NameFormatterTab(parent.helpDiag));
    tabs.add(new XmpPrefsTab());
        tabs.add(new AdvancedTab(prefs, parent.helpDiag));
   
    Iterator<PrefsTab> it = tabs.iterator();
    String[] names = new String[tabs.size()];
    int i = 0;
        //ArrayList<Component> comps = new ArrayList<Component>();
        while (it.hasNext()) {
      PrefsTab tab = it.next();
      names[i++] = tab.getTabName();
      main.add((Component) tab, tab.getTabName());
        }

    upper.setBorder(BorderFactory.createEtchedBorder());

    chooser = new JList(names);
    chooser.setBorder(BorderFactory.createEtchedBorder());
    // Set a prototype value to control the width of the list:
    chooser.setPrototypeCellValue("This should be wide enough");
    chooser.setSelectedIndex(0);
    chooser.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // Add the selection listener that will show the correct panel when
    // selection changes:
    chooser.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        if (e.getValueIsAdjusting())
          return;
        String o = (String) chooser.getSelectedValue();
        cardLayout.show(main, o);
      }
    });

    JPanel one = new JPanel(), two = new JPanel();
    one.setLayout(new BorderLayout());
View Full Code Here

TOP

Related Classes of java.awt.CardLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.