Package com.alee.laf.button

Examples of com.alee.laf.button.WebButton


     * {@inheritDoc}
     */
    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        final WebButton notification1 = new WebButton ( "Simple custom content" );
        notification1.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                final WebNotification notificationPopup = new WebNotification ();
                notificationPopup.setIcon ( NotificationIcon.question );

                final JLabel label = new JLabel ( "Are you sure you want to" );
                final WebButton button = new WebButton ( "discard changes?" );
                button.setRolloverDecoratedOnly ( true );
                button.setDrawFocus ( false );
                button.setLeftRightSpacing ( 0 );
                button.setBoldFont ();
                button.addActionListener ( new ActionListener ()
                {
                    /**
                     * {@inheritDoc}
                     */
                    @Override
                    public void actionPerformed ( final ActionEvent e )
                    {
                        notificationPopup.hidePopup ();
                    }
                } );
                final CenterPanel centerPanel = new CenterPanel ( button, false, true );
                notificationPopup.setContent ( new GroupPanel ( 2, label, centerPanel ) );

                NotificationManager.showNotification ( notificationPopup );
            }
        } );

        final WebButton notification2 = new WebButton ( "Limited duration notification" );
        notification2.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                final WebNotification notificationPopup = new WebNotification ();
View Full Code Here


        // Initial transition panel state
        componentTransition.setContent ( image1 );
        componentTransition.setPreferredSize ( SwingUtils.max ( image1, image2 ) );

        // Images switch button
        final WebButton switchView = new WebButton ( loadIcon ( "switch.png" ) );
        switchView.setDrawFocus ( false );
        switchView.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                if ( componentTransition.getContent () == image1 )
                {
                    componentTransition.performTransition ( image2 );
                }
                else if ( componentTransition.getContent () == image2 )
                {
                    componentTransition.performTransition ( image3 );
                }
                else
                {
                    componentTransition.performTransition ( image1 );
                }
            }
        } );
        componentTransition.addTransitionListener ( new TransitionListener ()
        {
            @Override
            public void transitionStarted ()
            {
                switchView.setEnabled ( false );
            }

            @Override
            public void transitionFinished ()
            {
                switchView.setEnabled ( true );
            }
        } );

        return new GroupPanel ( 10, componentTransition, new CenterPanel ( switchView ) );
    }
View Full Code Here

    }

    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        WebButton showFrame = new WebButton ( "Show option pane", loadIcon ( "option.png" ) );
        showFrame.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                // Enabling dialog decoration
View Full Code Here

    }

    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        WebButton showFrame = new WebButton ( "Show dialog", loadIcon ( "dialog.png" ) );
        showFrame.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                // Enabling dialog decoration
View Full Code Here

        wig.addImage ( loadIcon ( "3.jpg" ) );
        wig.addImage ( loadIcon ( "4.jpg" ) );
        wig.addImage ( loadIcon ( "5.jpg" ) );
        imagegalleryPanel.add ( wig.getView ( false ), BorderLayout.CENTER );

        WebButton add = new WebButton ( "Add", loadIcon ( "add.png" ) );
        add.setRound ( StyleConstants.smallRound );
        add.addActionListener ( new ActionListener ()
        {
            private WebFileChooser fileChooser = null;

            @Override
            public void actionPerformed ( ActionEvent e )
            {
                if ( fileChooser == null )
                {
                    fileChooser = new WebFileChooser ();
                    fileChooser.setDialogTitle ( "Choose an image to add" );
                    fileChooser.setMultiSelectionEnabled ( true );
                    fileChooser.setAcceptAllFileFilterUsed ( false );
                    fileChooser.addChoosableFileFilter ( GlobalConstants.IMAGES_FILTER );
                }
                if ( fileChooser.showOpenDialog ( owner ) == WebFileChooser.APPROVE_OPTION )
                {
                    for ( File file : fileChooser.getSelectedFiles () )
                    {
                        wig.addImage ( 0, new ImageIcon ( file.getAbsolutePath () ) );
                    }
                    wig.setSelectedIndex ( 0 );
                }
            }
        } );
        wigToolBar.add ( add );

        WebButton remove = new WebButton ( "Remove", loadIcon ( "remove.png" ) );
        remove.setRound ( StyleConstants.smallRound );
        remove.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                wig.removeImage ( wig.getSelectedIndex () );
View Full Code Here

        // Field with trailing component
        final WebTextField componentField = new WebTextField ( "Styled text field with leading component" );
        componentField.setFieldMargin ( 0, 0, 0, 6 );
        componentField.setPainter ( NinePatchUtils.loadNinePatchStatePainter ( getResource ( "sfield.xml" ) ) );
        componentField.setForeground ( Color.WHITE );
        final WebButton sButton = new WebButton ();
        sButton.setFocusable ( false );
        sButton.setUndecorated ( true );
        sButton.setLeftRightSpacing ( 0 );
        sButton.setMoveIconOnPress ( false );
        sButton.setCursor ( Cursor.getDefaultCursor () );
        sButton.setIcon ( searchIcon );
        sButton.setPressedIcon ( pSearchIcon );
        componentField.setTrailingComponent ( sButton );

        return new GroupPanel ( false, textField, passwordField, componentField );
    }
View Full Code Here

        // Initial transition panel state
        componentTransition.setContent ( toolBar1 );
        componentTransition.setPreferredSize ( SwingUtils.max ( toolBar1, toolBar2 ) );

        // States switch button
        final WebButton switchView = new WebButton ( loadIcon ( "switch.png" ) );
        switchView.setDrawFocus ( false );
        switchView.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                if ( componentTransition.getContent () == toolBar1 )
                {
                    effect.setDirection ( Direction.right );
                    componentTransition.performTransition ( toolBar2 );
                }
                else
                {
                    effect.setDirection ( Direction.left );
                    componentTransition.performTransition ( toolBar1 );
                }
            }
        } );
        componentTransition.addTransitionListener ( new TransitionListener ()
        {
            @Override
            public void transitionStarted ()
            {
                switchView.setEnabled ( false );
            }

            @Override
            public void transitionFinished ()
            {
                switchView.setEnabled ( true );
            }
        } );

        return new GroupPanel ( 10, componentTransition, new CenterPanel ( switchView ) );
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        final WebButton notification1 = new WebButton ( "Simple text notification" );
        notification1.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                NotificationManager.showNotification ( "Simple notification" );
            }
        } );

        final WebButton notification2 = new WebButton ( "Notification with custom icon" );
        notification2.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                NotificationManager.showNotification ( "Custom notification icon", NotificationIcon.tip.getIcon () );
            }
        } );

        final WebButton notification3 = new WebButton ( "Notification with options" );
        notification3.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                NotificationManager.showNotification ( "Choose one of available options...", NotificationIcon.database.getIcon (),
View Full Code Here

            content.add ( new WebTextField ( 15 ), "1,0" );

            content.add ( new WebLabel ( "Password", WebLabel.TRAILING ), "0,1" );
            content.add ( new WebPasswordField ( 15 ), "1,1" );

            WebButton login = new WebButton ( "Login" );
            WebButton cancel = new WebButton ( "Cancel" );
            ActionListener listener = new ActionListener ()
            {
                @Override
                public void actionPerformed ( ActionEvent e )
                {
                    setVisible ( false );
                }
            };
            login.addActionListener ( listener );
            cancel.addActionListener ( listener );
            content.add ( new CenterPanel ( new GroupPanel ( 5, login, cancel ) ), "0,2,1,2" );
            SwingUtils.equalizeComponentsWidths ( login, cancel );

            add ( content );
View Full Code Here

    }

    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        WebButton showFrame = new WebButton ( "Show file chooser", loadIcon ( "file.png" ) );
        showFrame.addActionListener ( new ActionListener ()
        {
            private WebFileChooser fileChooser = null;

            private WebFileChooser getFileChooser ()
            {
View Full Code Here

TOP

Related Classes of com.alee.laf.button.WebButton

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.