java - How i can create button as shown in picture? -
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
Post a Comment