Package com.alee.laf.label

Examples of com.alee.laf.label.WebLabel


    }

    private static void setupTabbedPane ( JTabbedPane tabbedPane )
    {
        // Simple tab
        tabbedPane.addTab ( "Normal 1", new WebLabel () );

        // Disabled tab
        tabbedPane.addTab ( "Disabled 2", new WebLabel () );
        tabbedPane.setEnabledAt ( 1, false );

        // Selected tab
        tabbedPane.addTab ( "Selected 3", new WebLabel () );
        tabbedPane.setSelectedIndex ( 2 );

        // Colored tab
        tabbedPane.addTab ( "Colored 4", new WebLabel () );
        tabbedPane.setBackgroundAt ( 3, new Color ( 255, 212, 161 ) );
    }
View Full Code Here


        // Toolbar #2
        final WebToolBar toolBar2 = new WebToolBar ( WebToolBar.HORIZONTAL );
        toolBar2.setFloatable ( false );
        toolBar2.addSpacing ();
        toolBar2.add ( new WebLabel ( "Curtain transition example" ) );
        toolBar2.addSpacing ();
        componentTransition.setContent ( toolBar2 );

        // Initial transition panel state
        componentTransition.setContent ( toolBar1 );
View Full Code Here

                wig.removeImage ( wig.getSelectedIndex () );
            }
        } );
        wigToolBar.add ( remove );

        WebLabel infoLabel = new WebLabel ( "To add an image simply drag it to the gallery", loadIcon ( "info.png" ), WebLabel.CENTER );
        infoLabel.setForeground ( Color.DARK_GRAY );
        infoLabel.setMargin ( 0, 4, 0, 4 );
        wigToolBar.addToEnd ( infoLabel );

        SwingUtils.equalizeComponentsSize ( add, remove );

        return imagegalleryPanel;
View Full Code Here

            layout.setVGap ( 5 );
            WebPanel content = new WebPanel ( layout );
            content.setMargin ( 15, 30, 15, 30 );
            content.setOpaque ( false );

            content.add ( new WebLabel ( "Login", WebLabel.TRAILING ), "0,0" );
            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 ()
View Full Code Here

    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        // Label styled with nine-patch icon painter
        final NinePatchIcon icon = NinePatchUtils.loadNinePatchIcon ( getResource ( "label.xml" ) );
        final WebLabel label = new WebLabel ( "Sample text within styled label", WebLabel.CENTER );
        label.setPainter ( new NPLabelPainter ( icon ) ).setForeground ( Color.WHITE );
        return label;
    }
View Full Code Here

        final WebPanel panel = new WebPanel ();
        panel.setOpaque ( false );
        panel.setPainter ( NinePatchUtils.loadNinePatchIconPainter ( getResource ( "panel.xml" ) ) );

        // Panel content
        final WebLabel label = new WebLabel ( "<html><center>Sample text inside styled panel<br>" +
                "Note that margins are automatically set by the image file</center></html>" );
        label.setHorizontalAlignment ( WebLabel.CENTER );
        label.setForeground ( Color.WHITE );
        panel.add ( label );

        return panel;
    }
View Full Code Here

                        entry.getValue ().setCodeFoldingEnabled ( allowCodeFolding.isSelected () );
                    }
                }
            }
        } );
        final WebLabel allowCodeFoldingLabel = new WebLabel ( "Allow code folding" );
        allowCodeFoldingLabel.setDrawShade ( true );
        allowCodeFoldingLabel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                if ( SwingUtils.isLeftMouseButton ( e ) )
                {
                    allowCodeFolding.requestFocusInWindow ();
                    allowCodeFolding.doClick ();
                }
            }
        } );
        popupContent.add ( new GroupPanel ( 5, allowCodeFolding, allowCodeFoldingLabel ) );

        paintTabLines = new WebToggleButton ( loadEditorIcon ( "paintTabLines" ) );
        paintTabLines.registerSettings ( SETTINGS_PREFIX + "paintTabLines", false );
        paintTabLines.addItemListener ( new ItemListener ()
        {
            @Override
            public void itemStateChanged ( final ItemEvent e )
            {
                synchronized ( activeEditorsLock )
                {
                    for ( final Map.Entry<JarEntry, RSyntaxTextArea> entry : activeEditors.entrySet () )
                    {
                        entry.getValue ().setPaintTabLines ( paintTabLines.isSelected () );
                    }
                }
            }
        } );
        final WebLabel paintTabLinesLabel = new WebLabel ( "Paint tab lines" );
        paintTabLinesLabel.setDrawShade ( true );
        paintTabLinesLabel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                if ( SwingUtils.isLeftMouseButton ( e ) )
                {
                    paintTabLines.requestFocusInWindow ();
                    paintTabLines.doClick ();
                }
            }
        } );
        popupContent.add ( new GroupPanel ( 5, paintTabLines, paintTabLinesLabel ) );

        showWhitespaces = new WebToggleButton ( loadEditorIcon ( "showWhitespaces" ) );
        showWhitespaces.registerSettings ( SETTINGS_PREFIX + "showWhitespaces", false );
        showWhitespaces.addItemListener ( new ItemListener ()
        {
            @Override
            public void itemStateChanged ( final ItemEvent e )
            {
                synchronized ( activeEditorsLock )
                {
                    for ( final Map.Entry<JarEntry, RSyntaxTextArea> entry : activeEditors.entrySet () )
                    {
                        entry.getValue ().setWhitespaceVisible ( showWhitespaces.isSelected () );
                    }
                }
            }
        } );
        final WebLabel showWhitespacesLabel = new WebLabel ( "Show whitespaces" );
        showWhitespacesLabel.setDrawShade ( true );
        showWhitespacesLabel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                if ( SwingUtils.isLeftMouseButton ( e ) )
                {
                    showWhitespaces.requestFocusInWindow ();
                    showWhitespaces.doClick ();
                }
            }
        } );
        popupContent.add ( new GroupPanel ( 5, showWhitespaces, showWhitespacesLabel ) );

        showEol = new WebToggleButton ( loadEditorIcon ( "showEol" ) );
        showEol.registerSettings ( SETTINGS_PREFIX + "showEol", false );
        showEol.addItemListener ( new ItemListener ()
        {
            @Override
            public void itemStateChanged ( final ItemEvent e )
            {
                synchronized ( activeEditorsLock )
                {
                    for ( final Map.Entry<JarEntry, RSyntaxTextArea> entry : activeEditors.entrySet () )
                    {
                        entry.getValue ().setEOLMarkersVisible ( showEol.isSelected () );
                    }
                }
            }
        } );
        final WebLabel showEolLabel = new WebLabel ( "Show end of line" );
        showEolLabel.setDrawShade ( true );
        showEolLabel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                if ( SwingUtils.isLeftMouseButton ( e ) )
View Full Code Here

                loadTheme ( theme.getSelectedItem ().toString ().toLowerCase (), source );

                return sourceScroll;
            }
        }
        return new WebLabel ();
    }
View Full Code Here

    private static Component createDescription ( final Example example, final ExampleGroup group )
    {
        final Color foreground = group.getPreferredForeground ();

        final WebLabel titleLabel = new WebLabel ( example.getTitle (), JLabel.TRAILING );
        titleLabel.setDrawShade ( true );
        titleLabel.setForeground ( foreground );
        if ( foreground.equals ( Color.WHITE ) )
        {
            titleLabel.setShadeColor ( Color.BLACK );
        }

        if ( example.getDescription () == null )
        {
            return titleLabel;
        }
        else
        {
            final WebLabel descriptionLabel = new WebLabel ( example.getDescription (), WebLabel.TRAILING );
            descriptionLabel.setForeground ( Color.GRAY );
            SwingUtils.changeFontSize ( descriptionLabel, -1 );

            final WebPanel vertical = new WebPanel ( new VerticalFlowLayout ( VerticalFlowLayout.MIDDLE, 0, 0, true, false ) );
            vertical.setOpaque ( false );
            vertical.add ( titleLabel );
View Full Code Here

    private static Component createMark ( final WebLookAndFeelDemo owner, final Example example )
    {
        final FeatureState fs = example.getFeatureState ();
        final ImageIcon fsIcon = fs.getIcon ();
        final WebLabel featureState = new WebLabel ( fsIcon );
        TooltipManager.setTooltip ( featureState, fsIcon, fs.getDescription (), TooltipWay.up );
        featureState.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                owner.showLegend ( featureState, fs );
View Full Code Here

TOP

Related Classes of com.alee.laf.label.WebLabel

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.