Package com.alee.laf.text

Examples of com.alee.laf.text.WebTextField


    searchWidget.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    searchWidget.setTitle("Search - Powered by VK");
    searchWidget.setSize(451, 382);
    searchWidget.getContentPane().setLayout(null);

    searchBar = new WebTextField(0);
    searchBar.addActionListener(e -> VKEngine.search());
    searchBar.setInputPrompt("Lana Del Ray...");

    searchBar.setBackground(new Color(35, 35, 35));
    searchBar.setForeground(Color.GRAY);
View Full Code Here


        WebButton b3 = new WebButton ( "Button" );
        webComponentPanel.addElement ( new GridPanel ( 10, b1, b2, b3 ) );

        // Adding a panel with label and field
        WebLabel label = new WebLabel ( "Field" );
        WebTextField field = new WebTextField ();
        field.putClientProperty ( GroupPanel.FILL_CELL, true );
        webComponentPanel.addElement ( new GroupPanel ( 10, label, field ) );

        // Adding a simple slider
        WebSlider slider = new WebSlider ( WebSlider.HORIZONTAL, 0, 100, 50 );
        webComponentPanel.addElement ( slider );

        // Adding a panel with textfields
        WebTextField f1 = new WebTextField ();
        WebTextField f2 = new WebTextField ();
        WebTextField f3 = new WebTextField ();
        webComponentPanel.addElement ( new GridPanel ( 10, f1, f2, f3 ) );

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

        b.add ( panel1 );

        // Label and text field panel
        final WebBreadcrumbPanel panel2 = new WebBreadcrumbPanel ( new HorizontalFlowLayout () );
        panel2.add ( new WebLabel ( "Field:" ) );
        final WebTextField textField = new WebTextField ( 5 );
        SwingUtils.setFontSize ( textField, 8 );
        panel2.add ( textField );
        b.add ( panel2 );

        // Check box panel
View Full Code Here

        layout.setHGap ( 5 );
        layout.setVGap ( 5 );
        panel.setLayout ( layout );

        panel.add ( new WebLabel ( "Field 1:" ), "0,0" );
        panel.add ( new WebTextField (), "1,0" );

        panel.add ( new WebLabel ( "Field 2:" ), "0,1" );
        panel.add ( new WebCheckBox ( "Some check" ), "1,1" );

        return panel;
View Full Code Here

    {
        // Overlay
        final WebOverlay overlayPanel = new WebOverlay ();

        // Overlayed text field
        final WebTextField textField = new WebTextField ( 15 );
        overlayPanel.setComponent ( textField );

        // Label displayed as overlay when component is not focused
        final WebLabel overlay = new WebLabel ( "Enter text here..." )
        {
            @Override
            public boolean contains ( final int x, final int y )
            {
                // Making label invisible for mouse events
                return false;
            }
        };
        overlay.setForeground ( Color.GRAY );
        textField.addFocusListener ( new ConditionalVisibilityListener ( overlay, false, null )
        {
            @Override
            public boolean isVisible ()
            {
                return super.isVisible () && textField.getText ().equals ( "" );
            }
        } );
        overlayPanel.addOverlay ( overlay, SwingConstants.CENTER, SwingConstants.CENTER );

        return new GroupPanel ( overlayPanel );
View Full Code Here

    {
        // Single painter used for all example fields
        final NinePatchStatePainter npfbp = NinePatchUtils.loadNinePatchStatePainter ( getResource ( "field.xml" ) );

        // Text field
        final WebTextField textField = new WebTextField ( "Styled text field" );
        textField.setPainter ( npfbp );

        // Password field
        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

        final GroupPanel tg = new GroupPanel ( 5, new WebLabel ( "Display animation:" ), type );

        hidingType = new WebComboBox ( DynamicMenuType.values (), DynamicMenuType.star );
        final GroupPanel htg = new GroupPanel ( 5, new WebLabel ( "Hide animation:" ), hidingType );

        radius = new WebTextField ( new IntTextDocument (), "70", 4 );
        final GroupPanel rg = new GroupPanel ( 5, new WebLabel ( "Menu radius:" ), radius );

        itemsAmount = new WebTextField ( new IntTextDocument (), "5", 4 );
        final GroupPanel iag = new GroupPanel ( 5, new WebLabel ( "Items amount:" ), itemsAmount );

        drawBorder = new WebCheckBox ( "Show custom border", true );

        final WebPanel clickPanel = new WebPanel ( true );
View Full Code Here

        // Panel with focusable field
        final WebPanel panel1 = new WebPanel ( true );
        panel1.setPaintFocus ( true );
        panel1.setMargin ( 10 );
        panel1.add ( new WebLabel ( "Some field:", WebLabel.CENTER ), BorderLayout.NORTH );
        panel1.add ( new WebTextField ( "TextField", 6 ), BorderLayout.CENTER );

        // Panel with focusable button
        final WebPanel panel2 = new WebPanel ( true );
        panel2.setPaintFocus ( true );
        panel2.setMargin ( 10 );
View Full Code Here

    @Override
    public Component getPreview ( final WebLookAndFeelDemo owner )
    {
        // Text field input prompt
        final WebTextField textField = new WebTextField ( 15 );
        textField.setInputPrompt ( "Enter text..." );
        textField.setInputPromptFont ( textField.getFont ().deriveFont ( Font.ITALIC ) );

        // Password field input prompt
        final WebPasswordField passwordField = new WebPasswordField ( 15 );
        passwordField.setInputPrompt ( "Enter pass..." );
        passwordField.setHideInputPromptOnFocus ( false );
View Full Code Here

    @Override
    public Component getPreview ( WebLookAndFeelDemo owner )
    {
        // Text field with checkbox as leading component
        WebTextField leading = new WebTextField ( "Leading", 10 );
        leading.setMargin ( 0, 2, 0, 0 );
        WebCheckBox checkBox = new WebCheckBox ();
        checkBox.setCursor ( Cursor.getDefaultCursor () );
        checkBox.setSelected ( true );
        checkBox.setFocusable ( false );
        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

TOP

Related Classes of com.alee.laf.text.WebTextField

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.