Package java.awt

Examples of java.awt.CardLayout


        pack();
    }//GEN-END:initComponents

    private void button1ActionPerformed(java.awt.event.ActionEvent evt)
    {//GEN-FIRST:event_button1ActionPerformed
        CardLayout l = (CardLayout) panel5.getLayout();
        l.next(panel5);
    }//GEN-LAST:event_button1ActionPerformed
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

        return new JScrollPane(list);
    }

    protected Component buildConfigPanel(){
        JPanel configPanel = new JPanel();
        CardLayout cardLayout = new CardLayout();
        configPanel.setLayout(cardLayout);
        configPanel.add(buildUserLanguage(),
                        Resources.getString(LABEL_USER_LANGUAGE));

        configPanel.add(buildUserStyleSheet(),
View Full Code Here

     * This itemStateChanged listener for changing the card layout for based on\
     * the test selected in the User defined test case.
     */
    public void itemStateChanged(ItemEvent ie)
    {
        CardLayout cl = (CardLayout)(cards.getLayout());
        if (user_Defined.isSelected())
        {
            if (addTest.isSelected())
            {
                cl.show(cards,"Add");
                tableModifyPanel.clear();
                searchbase.setText("");
                searchfilter.setText("");
                delete.setText("");
            }
            else if(deleteTest.isSelected())
            {
                cl.show(cards,"Delete");
                tableModifyPanel.clear();
                tableAddPanel.clear();
                searchbase.setText("");
                searchfilter.setText("");
            }
            else if(searchTest.isSelected())
            {
                cl.show(cards,"Search");
                delete.setText("");
                tableModifyPanel.clear();
                tableAddPanel.clear();
            }
            else if(modifyTest.isSelected())
            {
                cl.show(cards,"Modify");
                tableAddPanel.clear();
                searchbase.setText("");
                searchfilter.setText("");
                delete.setText("");
            }
            else
            {
                cl.show(cards,"");
                tableAddPanel.clear();
                tableModifyPanel.clear();
                searchbase.setText("");
                searchfilter.setText("");
                delete.setText("");
            }
        }
        else
        {
            cl.show(cards,"");
            tableAddPanel.clear();
            tableModifyPanel.clear();
            searchbase.setText("");
            searchfilter.setText("");
            delete.setText("");
View Full Code Here

     * delete or search based on the panel selected in the itemevent in the
     * LdapConfigGui.
     */
    private JPanel testPanel()
    {
        cards = new JPanel(new CardLayout());
        cards.add(new JPanel(),"");
        cards.add(createAddPanel(),"Add");
        cards.add(createModifyPanel(),"Modify");
        cards.add(createDeletePanel(),"Delete");
        cards.add(createSearchPanel(),"Search");
View Full Code Here

    {
        super.configure(element);
        servername.setText(element.getPropertyAsString(LDAPSampler.SERVERNAME));
        port.setText(element.getPropertyAsString(LDAPSampler.PORT));
        rootdn.setText(element.getPropertyAsString(LDAPSampler.ROOTDN));
        CardLayout cl = (CardLayout)(cards.getLayout());
        if (element.getPropertyAsString(LDAPSampler.TEST).equals("add"))
        {
            addTest.setSelected(true);
            add.setText(element.getPropertyAsString(LDAPSampler.BASE_ENTRY_DN));
            tableAddPanel.configure(
                (TestElement) element
                    .getProperty(LDAPSampler.ARGUMENTS)
                    .getObjectValue());
            cl.show(cards,"Add");
        }
        else if (element.getPropertyAsString(LDAPSampler.TEST).equals("modify"))
        {
            modifyTest.setSelected(true);
            modify.setText(
                element.getPropertyAsString(LDAPSampler.BASE_ENTRY_DN));
            tableModifyPanel.configure(
                (TestElement) element
                    .getProperty(LDAPSampler.ARGUMENTS)
                    .getObjectValue());
            cl.show(cards,"Modify");
        }
        else if (element.getPropertyAsString(LDAPSampler.TEST).equals("delete"))
        {
            deleteTest.setSelected(true);
            delete.setText(element.getPropertyAsString(LDAPSampler.DELETE));
            cl.show(cards,"Delete");
        }
        else if (element.getPropertyAsString(LDAPSampler.TEST).equals("search"))
        {
            searchTest.setSelected(true);
            searchbase.setText(
                element.getPropertyAsString(LDAPSampler.SEARCHBASE));
            searchfilter.setText(
                element.getPropertyAsString(LDAPSampler.SEARCHFILTER));
            cl.show(cards,"Search");
        }

        if (element.getPropertyAsBoolean(LDAPSampler.USER_DEFINED))
        {
            user_Defined.setSelected(true);
        }
        else
        {
            user_Defined.setSelected(false);
            cl.show(cards,"");
        }
    }
View Full Code Here

   
    public DistributionPanel()
    {
        super(new BorderLayout());
        final CardLayout parametersLayout = new CardLayout();
        final JPanel parametersPanel = new JPanel(parametersLayout);
        for (Map.Entry<String, ParametersPanel> entry : parameterPanels.entrySet())
        {
            distributionCombo.addItem(entry.getKey());
            parametersPanel.add(entry.getValue(), entry.getKey());
        }
        parametersLayout.first(parametersPanel);

        distributionCombo.addItemListener(new ItemListener()
        {
            public void itemStateChanged(ItemEvent itemEvent)
            {
                parametersLayout.show(parametersPanel,
                                      (String) distributionCombo.getSelectedItem());
            }
        });

        add(distributionCombo, BorderLayout.NORTH);
View Full Code Here

    moduleDropdownPanel.setEnabled(false);
    moduleDropdownPanel.setVisible(false);
    topPanel.add(moduleDropdownPanel);
    add(topPanel, BorderLayout.NORTH);
    deckPanel = new JPanel();
    cardLayout = new CardLayout();
    deckPanel.setLayout(cardLayout);
    add(deckPanel);
   
    // Construct the tab title and tooltip
    String tabTitle = url;
View Full Code Here

public class CardLayoutParser extends LayoutParser {


  @Override
  protected String getNewInstanceCode(ImportRewrite imports) {
    CardLayout layout = (CardLayout) layoutAdapter.getContainer().getLayout();
    int hgap = layout.getHgap();
    int vgap = layout.getVgap();
    String strLayoutName= imports.addImport("java.awt.CardLayout");
    if (hgap != 0 || vgap != 0) {
      return "new "+strLayoutName+"(" + hgap + ", " + vgap + ")";
    } else {
      return "new "+strLayoutName+"()";
View Full Code Here

      }
    }
  }

  public WhatsNewWindow() {
    final CardLayout cardLayout = new CardLayout();
    final JPanel cards = new JPanel(cardLayout);
    DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
    final String[] changeLog = getText().split("\n\n");

    // Split up the change log by version
    for(String entry : changeLog) {
      String[] data = entry.split("\n", 2);
      JTextComponent jta = new ColoredTextArea();
      jta.setText(data[1]);
      jta.setEditable(false);
      cards.add(data[0], new JScrollPane(jta));
      model.addElement(data[0]);
    }

    JComboBox<String> cb = new JComboBox<String>(model);
    cb.setEditable(false);
    cb.addItemListener(new ItemListener() {
      @Override
      public void itemStateChanged(ItemEvent e) {
        cardLayout.show(cards, (String)e.getItem());
      }});
    JPanel comboBoxPane = new JPanel();
    comboBoxPane.add(cb);

    JButton btnOK = new JButton("OK");
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.