Adding Icon to a JLabel

From: J. Babe (babe_jt_at_hotmail.com)
Date: 05/27/04


Date: 26 May 2004 16:01:53 -0700

I'm new to Java GUI and I'm trying to add an icon to an object that
extends a JLabel. I have the following code, but the icon doesn't
appear, I was wondering what my problem would be (paintIcon()?)
Thanks.

public class FileTarget extends javax.swing.JLabel implements
DropTargetListener, DragGestureListener {
    
    private Vector filearr = new Vector();
    
    public FileTarget(Icon image) {
        super(image, (int)JLabel.CENTER_ALIGNMENT);
        this.dTarget = new DropTarget(this, this);
    }



Relevant Pages

  • Re: Adding Icon to a JLabel
    ... but the icon doesn't ... >:public class FileTarget extends javax.swing.JLabel implements ... If that's the only constructor you have, ... Steve W. Jackson ...
    (comp.lang.java.gui)
  • Re: table formatting problems
    ... I just clicked on the toolbar's table icon to create the table and it only ... centering the text in the cells is off ... text that extends beyond the column width disappears to the right. ...
    (microsoft.public.word.newusers)