java怎么将标签弄成圆形,如何在Java中制作圆形图像标签?

How to make Circle image Label in Java?

I wanna make circle image Label But I can't do this.. Hey guys Help me..T.T

I tried make circle panel for add image icon but that didn't work.

help me please...

解决方案

I think you should change your tack, instead of trying to modify the output of a component, instead, modify the input...

So all this does, is apply a circular (alpha based) mask to another image

BufferedImage master = ImageIO.read(new File("/Volumes/Disk02/Dropbox/MegaTokyo/thumnails/megatokyo_omnibus_1_3_cover_by_fredrin-d4oupef.jpg"));

int diameter = Math.min(master.getWidth(), master.getHeight());

BufferedImage mask = new BufferedImage(master.getWidth(), master.getHeight(), BufferedImage.TYPE_INT_ARGB);

你可能感兴趣的:(java怎么将标签弄成圆形)