1. #1
    Sencha User
    Join Date
    Feb 2013
    Location
    Russian federation, Smolensk
    Posts
    38
    Vote Rating
    0
    Answers
    5
    Mike_javaJunior is on a distinguished road

      0  

    Default Answered: how to add an icon to the button

    Answered: how to add an icon to the button


    the problem is that when I'm trying to set the icon for the button with
    button.setIcon()
    it asks for something that I cant understand what is it.
    it asks for AbstractImagePrototype
    I'm trying to create an instanse, it opens a constructor in which I don't cnow what to do.
    Code:
     AbstractImagePrototype aip = new AbstractImagePrototype() {            @Override
                public void applyTo(Image image) {
                    //To change body of implemented methods use File | Settings | File Templates.
                }
    
    
                @Override
                public Image createImage() {
                    return null;  //To change body of implemented methods use File | Settings | File Templates.
                }
    
    
                @Override
                public String getHTML() {
                    return null;  //To change body of implemented methods use File | Settings | File Templates.
                }
            }
    so help me please. How can I set the icon to the button?

  2. Oh! thank you all. I've found the solution myself.
    my problem was that this way is wrong. to add an icon to the button I need to use button.setIconStyle() and that's it. everything is simple and works. the only problem is that the icon must have the concrete size, otherwise it won't be seen or will be too small.

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    Russian federation, Smolensk
    Posts
    38
    Vote Rating
    0
    Answers
    5
    Mike_javaJunior is on a distinguished road

      0  

    Default


    Oh! thank you all. I've found the solution myself.
    my problem was that this way is wrong. to add an icon to the button I need to use button.setIconStyle() and that's it. everything is simple and works. the only problem is that the icon must have the concrete size, otherwise it won't be seen or will be too small.