Examples of WebNotification


Examples of com.alee.managers.notification.WebNotification

        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 ();
                notificationPopup.setIcon ( NotificationIcon.clock );
                notificationPopup.setDisplayTime ( 5000 );

                final WebClock clock = new WebClock ();
                clock.setClockType ( ClockType.timer );
                clock.setTimeLeft ( 6000 );
                clock.setTimePattern ( "'This notification will close in' ss 'seconds'" );
                notificationPopup.setContent ( new GroupPanel ( clock ) );

                NotificationManager.showNotification ( notificationPopup );
                clock.start ();
            }
        } );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.