babyblue
20 Jul 2010, 2:11 PM
I'm trying to implement a simple color picker:
Button colorButton = new Button("");
ColorMenu colorMenu = new ColorMenu();
colorMenu.getColorPalette().addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
System.out.println(((ColorPalette) be.getComponent()).getValue());
}
});
colorButton.setMenu(colorMenu);
colorButton.setStyleAttribute("background-image", "none");
I understand that buttons have a background image set by the default css, I tried to overwrite it but didn't seem to do anything.
Button colorButton = new Button("");
ColorMenu colorMenu = new ColorMenu();
colorMenu.getColorPalette().addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
System.out.println(((ColorPalette) be.getComponent()).getValue());
}
});
colorButton.setMenu(colorMenu);
colorButton.setStyleAttribute("background-image", "none");
I understand that buttons have a background image set by the default css, I tried to overwrite it but didn't seem to do anything.