Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to remove line around label image

Reply
Thread Tools

How to remove line around label image

 
 
clusardi2k
Guest
Posts: n/a
 
      08-20-2012
From: http://www.velocityreviews.com/forums/(E-Mail Removed)

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,

--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/3
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      08-20-2012
To: clusardi2k
From: Knute Johnson <(E-Mail Removed)>

On 8/20/2012 10:18 AM, (E-Mail Removed) 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,
>


We need to see some code. I don't see the problem you describe in the code
below. Are you using AWT?

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.net.*;
import javax.swing.*;

public class test2 extends JPanel {
private JLabel l;

public test2() {
super(new GridBagLayout());

GridBagConstraints c = new GridBagConstraints();

setPreferredSize(new Dimension(240,180));
try {
// use blue.png if you want to see the image
URL url = new URL("http://knutejohnson.com/white.png");
ImageIcon icon = new ImageIcon(url);
l = new JLabel(icon);
} catch (MalformedURLException murle) {
murle.printStackTrace();
}

add(l,c);
}

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
JFrame f = new JFrame("test2");
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE );
test2 t2 = new test2();
f.add(t2,BorderLayout.CENTER);
f.pack();
f.setVisible(true);
}
});
}
}



--

Knute Johnson

--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/3
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      08-20-2012
To: clusardi2k
From: Eric Sosman <(E-Mail Removed)>

On 8/20/2012 1:18 PM, (E-Mail Removed) 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_CLOS E);
ImageIcon icon = new ImageIcon("icon.jpg");
frame.add(new JLabel(icon));
frame.pack();
frame.setVisible(true);
}
});
}
}

--
Eric Sosman
(E-Mail Removed)d

--- BBBS/Li6 v4.10 Dada-1
* Origin: Prism bbs (1:261/3
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Get rid of border line around linked image Kian HTML 18 11-27-2012 10:03 PM
How to remove line around label image clusardi2k@aol.com Java 9 08-21-2012 05:49 PM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
Read all of this to understand how it works. then check around on otherRead all of this to understand how it works. then check around on other thelisa martin Computer Support 2 08-18-2005 06:40 AM



Advertisments