Package com.alee.extended.image

Examples of com.alee.extended.image.WebImage


    searchBar.setBackground(new Color(35, 35, 35));
    searchBar.setForeground(Color.GRAY);
    searchBar.setFont(new Font("Calibri", Font.PLAIN, 16));
    searchBar.setLocation(0, 0);
    searchBar.setMargin(0, 0, 0, 2);
    final WebImage webImage = new WebImage(Utils.loadIcon("search.png"));
    searchBar.setTrailingComponent(webImage);
    searchBar.setSize(302, 25);
    searchWidget.getContentPane().add(searchBar);

    comboBox = new JComboBox<String>();
View Full Code Here


        // Overlayed label
        WebLabel component = new WebLabel ( "Mouseover the small icon" );
        overlayPanel.setComponent ( component );

        // Image displayed as overlay
        WebImage overlay = new WebImage ( loadIcon ( "small.png" ) );
        TooltipManager.setTooltip ( overlay, "Overlay with tooltip", TooltipWay.trailing, 0 );
        overlayPanel.addOverlay ( overlay, SwingConstants.TRAILING, SwingConstants.TOP );
        overlayPanel.setComponentMargin ( 0, 0, 0, overlay.getPreferredSize ().width );

        return new GroupPanel ( overlayPanel );
    }
View Full Code Here

        return new GroupPanel ( 10, imagesPanel, new CenterPanel ( reloadView ) );
    }

    private WebImage createImage ( String src )
    {
        return new WebImage ( loadIcon ( "images/" + src ) );
    }
View Full Code Here

        final WebPasswordField passwordField = new WebPasswordField ( "Styled password field" );
        passwordField.setPainter ( npfbp );

        // Field with leading component
        final WebTextField componentField = new WebTextField ( "Styled text field with leading component" );
        componentField.setLeadingComponent ( new WebImage ( loadIcon ( "search.png" ) ) );
        componentField.setFieldMargin ( 0, 6, 0, 0 );
        componentField.setPainter ( npfbp );

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

        leading.setLeadingComponent ( checkBox );

        // Text field with image as trailing component
        WebTextField trailing = new WebTextField ( "Trailing", 10 );
        trailing.setMargin ( 0, 0, 0, 2 );
        trailing.setTrailingComponent ( new WebImage ( loadIcon ( "search.png" ) ) );

        // Password field with image as leading component
        WebPasswordField leading2 = new WebPasswordField ( "Leading", 10 );
        leading2.setLeadingComponent ( new WebImage ( loadIcon ( "key.png" ) ) );

        // Password field with image as trailing component
        WebPasswordField trailing2 = new WebPasswordField ( "Trailing", 10 );
        trailing2.setTrailingComponent ( new WebImage ( loadIcon ( "key.png" ) ) );

        // Text field with image as leading and trailing components
        WebTextField both = new WebTextField ( "Both", 10 );
        both.setHorizontalAlignment ( WebTextField.CENTER );
        both.setMargin ( 0, 2, 0, 2 );
        WebImage image1 = new WebImage ( loadIcon ( "exclamation.png" ) );
        image1.setCursor ( Cursor.getDefaultCursor () );
        TooltipManager.setTooltip ( image1, "Some left message", TooltipWay.leading, 0 );
        both.setLeadingComponent ( image1 );
        WebImage image2 = new WebImage ( loadIcon ( "exclamation.png" ) );
        image2.setCursor ( Cursor.getDefaultCursor () );
        TooltipManager.setTooltip ( image2, "Some right message", TooltipWay.trailing, 0 );
        both.setTrailingComponent ( image2 );

        return new GroupPanel ( false, leading, trailing, leading2, trailing2, both );
    }
View Full Code Here

            {
                final WebPopOver popOver = new WebPopOver ( owner );
                popOver.setCloseOnFocusLoss ( true );
                popOver.setMargin ( 10 );
                popOver.setLayout ( new VerticalFlowLayout () );
                final WebImage icon = new WebImage ( WebLookAndFeel.getIcon ( 16 ) );
                final WebLabel titleLabel = new WebLabel ( "Pop-over dialog", WebLabel.CENTER );
                final WebButton closeButton = new WebButton ( loadIcon ( "cross2.png" ), new ActionListener ()
                {
                    @Override
                    public void actionPerformed ( final ActionEvent e )
View Full Code Here

    @Override
    public Component getPreview ( WebLookAndFeelDemo owner )
    {
        // Simple image
        WebImage webImage1 = new WebImage ( loadIcon ( "preferred.png" ) );
        TooltipManager.setTooltip ( webImage1, "Simple preferred-size image", TooltipWay.up );

        // Repeated image
        WebImage webImage2 = new WebImage ( loadIcon ( "repeated.png" ) );
        webImage2.setDisplayType ( DisplayType.repeat );
        webImage2.setVerticalAlignment ( WebImage.BOTTOM );
        webImage2.setHorizontalAlignment ( WebImage.RIGHT );
        webImage2.setPreferredSize ( webImage1.getPreferredSize () );
        TooltipManager.setTooltip ( webImage2, "Repeated and bottom-right aligned image", TooltipWay.up );

        // Filling image
        WebImage webImage3 = new WebImage ( loadIcon ( "fill.png" ) );
        webImage3.setDisplayType ( DisplayType.fitComponent );
        webImage3.setPreferredSize ( webImage1.getPreferredSize () );
        TooltipManager.setTooltip ( webImage3,
                "Scaled to fit component image (" + webImage3.getImageWidth () + "x" + webImage3.getImageHeight () +
                        " px)", TooltipWay.up
        );

        return new GroupPanel ( 4, webImage1, webImage2, webImage3 );
    }
View Full Code Here

    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        // Popup
        final WebPopup popup = new WebPopup ();
        popup.setMargin ( 20 );
        popup.add ( new WebImage ( loadIcon ( "move.png" ) ) );

        // Popup move mouse adapter
        ComponentMoveAdapter.install ( popup, popup );

        // Popup invoker button
View Full Code Here

    {
        ImageIcon i1 = loadIcon ( "1.jpg" );
        ImageIcon i2 = loadIcon ( "2.jpg" );
        ImageIcon i3 = loadIcon ( "3.jpg" );

        WebImage image1 = new WebImage ( i1 );
        image1.setTransferHandler ( new ImageDragHandler ( image1, i1 ) );

        WebImage image2 = new WebImage ( i2 );
        image2.setTransferHandler ( new ImageDragHandler ( image2, i2 ) );

        WebImage image3 = new WebImage ( i3 );
        image3.setTransferHandler ( new ImageDragHandler ( image3, i3 ) );

        GroupPanel imageGroup = new GroupPanel ( 4, image1, image2, image3 );


        WebLabel dragLabel = new WebLabel ( "Try dragging images into fields below", loadIcon ( "drag.png" ), WebLabel.CENTER );
View Full Code Here

        effect.setSpeed ( 4 );
        effect.setFade ( false );
        componentTransition.setTransitionEffect ( effect );

        // Effects
        final WebImage image1 = new WebImage ( loadIcon ( "pictures/1.jpg" ) );
        final WebImage image2 = new WebImage ( loadIcon ( "pictures/2.jpg" ) );
        final WebImage image3 = new WebImage ( loadIcon ( "pictures/3.jpg" ) );

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

TOP

Related Classes of com.alee.extended.image.WebImage

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.