Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: How to remove line around label image Date: Mon, 20 Aug 2012 14:16:20 -0400 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <824fad70-20cf-4b77-a9f1-296f6f1b8449@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 20 Aug 2012 18:16:28 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="ffb8f7085759b339c1002252b48331a4"; logging-data="7946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EaZPd0Te2ENdegwPqduL0" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <824fad70-20cf-4b77-a9f1-296f6f1b8449@googlegroups.com> Cancel-Lock: sha1:7qtHUaFG3W7AZZK9bBQMziNdTs4= Xref: csiph.com comp.lang.java.programmer:18181 On 8/20/2012 1:18 PM, clusardi2k@aol.com wrote: > How do I remove a line around a label image. I set the background and foreground color to the panel color and put a check in the property opaque checkbox. > > Thank you, > If you're sure the line is not part of the image itself (a border, perhaps), please post an SSSCE. This works fine for me: import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class Foo { public static void main(String[] unused) { SwingUtilities.invokeLater(new Runnable(){ @Override public void run() { JFrame frame = new JFrame("Foo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ImageIcon icon = new ImageIcon("icon.jpg"); frame.add(new JLabel(icon)); frame.pack(); frame.setVisible(true); } }); } } -- Eric Sosman esosman@ieee-dot-org.invalid