Re: How to remove line around label image
To: clusardi2k
From: Eric Sosman <esosman@ieee-dot-org.invalid>
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
--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24