Drawables and Images


#1

Toolbar wants the icons as Drawable and I keep all the icons as Drawable. I want to use same icons for Popups as well, but Popup wants an Image. How can I easily convert Drawable to an Image?


#2

I figured out the previous problem, actually it was a DrawableImage and I could get it’s image. But now I wan’t to show an Icon at the subitems at the PopUp. I know I can use a custom component, but I feel there should be an easy way.


#3

You can easily render a drawable to an image - just create an image, then a Graphics object to draw onto it, and use that to draw the drawable.


#4

I can draw an icon for the normal items of a PopUpMenu, but when I add an PopUpMenu as an subitem to a PopUpMenu, there is no way to give an icon for it.


#5

oh, I see what you mean. Yes, that’s something that would have to be added to the combobox. I’ll make a note of it…


#6

Thanks


#7