Package java.awt

Examples of java.awt.CardLayout$Card


        bcelldelete = resources.getButton("deleteCellButton", null);
        cbx = new JComboBox();
        cbx.setEditable(false);
        cbx.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                CardLayout cl = (CardLayout) (cards.getLayout());
                int index = cbx.getSelectedIndex();
                if (index >= 0) {
                    TextPropertiesPanel tpp = (TextPropertiesPanel) TextArrayPropertiesPanel.this.textPanels.get(index);
                    tpp.updateSourceTree();
                    cl.show(cards, Integer.toString(index));
                }
            }
        });
        bcelldelete.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int index = cbx.getSelectedIndex();
                textPanels.remove(index);
                updateCells();
                // Disable delete button in case there is only one cell.
                bcelldelete.setEnabled(textPanels.size() > 1);
                if (index > (textPanels.size() - 1)) {
                    index = textPanels.size() - 1;
                }
                TextPropertiesPanel tpp = (TextPropertiesPanel) TextArrayPropertiesPanel.this.textPanels.get(index);
                tpp.updateSourceTree();
                ((CardLayout) (cards.getLayout())).show(cards, Integer.toString(index));
            }
        });
        bcelladd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                JPropertiesPanel textPanel = createTextPropertiesPanel(false,Builtin.resources.getString("TextArray") );
                // New cell has same properties as the last cell created
                JPropertiesPanel textPanelModel = (JPropertiesPanel) textPanels.get(textPanels.size() - 1);
                String[] props = textPanelModel.getPropertyNames();
                if (props != null) {
                    for (int j = 0; j < props.length; j++) {
                        String pname = props[j];
                        textPanel.setPropertyValue(pname, textPanelModel.getPropertyValue(pname));
                    }
                }
                // fin test
                // Set new panel owner
                textPanel.setOwner(TextArrayPropertiesPanel.this.getOwner());
                // Add to the list of text cells panels
                textPanels.add(textPanel);
                // Disable delete button in case there is only one cell.
                bcelldelete.setEnabled(textPanels.size() > 1);
                updateCells();
                int index = textPanels.size() - 1;
                cbx.setSelectedIndex(index);
                TextPropertiesPanel tpp = (TextPropertiesPanel) TextArrayPropertiesPanel.this.textPanels.get(index);
                tpp.updateSourceTree();
                ((CardLayout) (cards.getLayout())).show(cards, Integer.toString(index));
                enableFontChoosers(!cbSameFont.isSelected());
            }
        });
        cards = new JPanel();
        cards.setLayout(new CardLayout());
        cbSameFont = new ActionCheckBox(resources.getString("UseAUniqueFontForTheWholeArray"), true) {
            public void actionPerformed(ActionEvent e) {
                if (cbSameFont.isSelected()) {
                    JPropertiesPanel jp = (JPropertiesPanel) TextArrayPropertiesPanel.this.textPanels.get(cbx
                            .getSelectedIndex());
View Full Code Here


   * @param e
   */
  public static void showQuickErrorDialog(JFrame parent, String title, Exception e) {
    // create and configure a text area - fill it with exception text.
    final JPanel pan = new JPanel(), details = new JPanel();
    final CardLayout crd = new CardLayout();
    pan.setLayout(crd);
    final JTextArea textArea = new JTextArea();
    textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 10));
    textArea.setEditable(false);
    StringWriter writer = new StringWriter();
    e.printStackTrace(new PrintWriter(writer));
    textArea.setText(writer.toString());
    JLabel lab = new JLabel(e.getMessage());
    JButton flip = new JButton(Globals.lang("Details"));

    FormLayout layout = new FormLayout("left:pref", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.append(lab);
    builder.nextLine();
    builder.append(Box.createVerticalGlue());
    builder.nextLine();
    builder.append(flip);
    final JPanel simple = builder.getPanel();

    // stuff it in a scrollpane with a controlled size.
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setPreferredSize(new Dimension(350, 150));
    details.setLayout(new BorderLayout());
    details.add(scrollPane, BorderLayout.CENTER);

    flip.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent event) {
        crd.show(pan, "details");
      }
    });
    pan.add(simple, "simple");
    pan.add(details, "details");
    // pass the scrollpane to the joptionpane.
View Full Code Here

        Box buttonBox = new Box(BoxLayout.X_AXIS);

        cardPanel = new JPanel();
        cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));      

        cardLayout = new CardLayout();
        cardPanel.setLayout(cardLayout);
       
        backButton = new JButton();
        nextButton = new JButton();
        cancelButton = new JButton();
View Full Code Here

    scroller = new JScrollPane(textPane) ; //, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS) ;
    scroller.setPreferredSize( about.getSize());

    // overlapped animated/scrollable area
    infoPanel = new JPanel() ;
    cards = new CardLayout() ;
    infoPanel.setLayout( cards);

    infoPanel.add(about, "ani") ;
    infoPanel.add(scroller, "inf") ;
View Full Code Here

    public WizardImpl(UIFacade uiFacade, String title) {
        // super(frame, title, true);
        myUIFacade = uiFacade;
        myTitle = title;
        myCardLayout = new CardLayout();
        myPagesContainer = new JPanel(myCardLayout);
        myNextAction = new NextAction();
        myBackAction = new BackAction();
    }
View Full Code Here

            constraints.gridy = 0;
            panelDouble.add(fieldDouble, constraints);
        }
        {
            panelDate = builder.createStandaloneOptionPanel(myDate);
            cardLayoutDefaultValue = new CardLayout();
            panelDefaultValue = new JPanel(cardLayoutDefaultValue);
            panelDefaultValue.add(cardText, panelText);
            panelDefaultValue.add(cardBoolean, panelBoolean);
            panelDefaultValue.add(cardInteger, panelInteger);
            panelDefaultValue.add(cardDouble, panelDouble);
View Full Code Here

            panelDouble = new JPanel(new BorderLayout());
            panelDouble.add(fieldDouble, BorderLayout.NORTH);
        }
        {
            panelDate = builder.createStandaloneOptionPanel(myDate);
            cardLayoutDefaultValue = new CardLayout();
            panelDefaultValue = new JPanel(cardLayoutDefaultValue);
            panelDefaultValue.add(cardText, panelText);
            panelDefaultValue.add(cardBoolean, panelBoolean);
            panelDefaultValue.add(cardInteger, panelInteger);
            panelDefaultValue.add(cardDouble, panelDouble);
View Full Code Here

    }
   
    void createComponents() {
        titleBar = new FolderBar();
        titleBar.setFont(titleBar.getFont().deriveFont(Font.BOLD).deriveFont((float)(titleBar.getFont().getSize() * 2)));
        pageContainer = new JPanel(pageCardLayout = new CardLayout());
        JPanel buttonBar = new JPanel(new FlowLayout(FlowLayout.RIGHT, 4, 0));
        buttonBar.setBorder(BorderFactory.createEmptyBorder(4, 0, 4, 0));
        buttonBar.add(new JButton(cancelAction));
        buttonBar.add(previousButton = new JButton(previousAction));
        buttonBar.add(nextButton = new JButton(nextAction));
View Full Code Here

            BorderFactory.createEmptyBorder(0, 0, 4, 0)));
        toolBar.setFolderBar(folderBar);

        JPanel centerPane = new JPanel(new BorderLayout());
        centerPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
        viewPane = new JPanel(layout = new CardLayout());
        centerPane.add(folderBar, BorderLayout.NORTH);
        centerPane.add(viewPane, BorderLayout.CENTER);
        add(scrolling, BorderLayout.WEST);
        add(centerPane, BorderLayout.CENTER);
    }
View Full Code Here

        toolBarBackground = UIManager.getColor("Panel.background").darker();

        // Intialise
        contextList = new Vector();
        cardLayout = new CardLayout();
        cardPanel = new JPanel(cardLayout);
        cardPanel.setOpaque(false);
        cardPanel.setBackground(toolBarBackground);

        // Create the constraints for use later
View Full Code Here

TOP

Related Classes of java.awt.CardLayout$Card

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.