java - How i can create button as shown in picture? -


enter image description here

how can create dynamic component shown in picture? component image change @ run time. component border , backgrond color should changable @ run time.

you can create button below,

jbutton button = new jbutton();  try {     image img = imageio.read(getclass().getresource("resources/water.bmp"));     button.seticon(new imageicon(img)); } catch (ioexception ex) {     //catch exceptions } 

you can call

button.seticon(new imageicon(img)); 

to change button image @ run time.

you can call

button.setbackground() 

to change background @ runtime.

have @ jbutton documentation more information.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -