Custom crystal button like win7
Download complete projectHttp://download.csdn.net/detail/jasper_success/4488514
KeyCode
Public void paintcomponent (Graphics g) {graphics2d g2 = (graphics2d) g; alphacomposite composite = alphacomposite. getinstance (alphacomposite. src_over, alpha); g2.setcomposite (composite); // draw the border if (this. ismouseentered) {util. drawbuttonbackground (G2, this, new color (253,236,219), new color (253,223,187), new color (255,206,105), new color (255,255,222 ));} // Effect of Button being pressed if (clicked) {util. drawbuttonbackg Round (G2, this, new color (255,199, 99), new color (253,236,219), new color (253,236,219, 99);} composite = alphacomposite. getinstance (alphacomposite. src_over, 1f); g2.setcomposite (composite); If (frametype = frame_around) {G. setcolor (config. color_toolbar_frame); G. drawroundrect (1, 1, getwidth ()-4, getheight ()-2, 3, 3);} else if (frametype = frame_right) {G. setcolor (config. Color_toolbar_frame); G. drawline (getwidth ()-1, 1, getwidth ()-1, getheight ()-2);} // eliminate the Sawtooth util. setfractionalmetricson (G2); // text style G. setcolor (config. color_ui_text); G. setfont (config. font_ui_text); // draw the icon if (getimage ()! = NULL) {G. drawimage (getimage (), (getwidth ()-getimage (). getwidth (this)/2, 5 + mbstatus, this); G. drawstring (getname (), (getwidth ()-getname (). length () * config. font_ui_text.getsize ()/2, getimage (). getheight (this) + mbstatus);} else {G. drawstring (getname (), (getwidth ()-getname (). length () * config. font_ui_text.getsize ()/2, 10 + mbstatus );}}
Download http://download.csdn.net/detail/jasper_success/4488514