-
14 Feb 2013 4:19 AM #1Sencha User
- Join Date
- Feb 2013
- Location
- Russian federation, Smolensk
- Posts
- 32
- Vote Rating
- 0
- Answers
- 5
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.
so help me please. How can I set the icon to the button?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. } }
-
Best Answer Posted by Mike_javaJunior
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.
-
18 Feb 2013 3:49 AM #2Sencha User
- Join Date
- Feb 2013
- Location
- Russian federation, Smolensk
- Posts
- 32
- Vote Rating
- 0
- Answers
- 5
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.


Reply With Quote