Re: jpg as background?
From: Evil Monkey (a_at_b.com)
Date: 12/28/03
- Next message: ak: "Re: jpg as background?"
- Previous message: Christopher Wong: "Re: jpg as background?"
- In reply to: ak: "Re: jpg as background?"
- Next in thread: willy: "Re: jpg as background?"
- Reply: willy: "Re: jpg as background?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 28 Dec 2003 17:24:27 -0000
"ak" <spam@imagero.com> wrote in message news:bskr11$rm4$1@online.de...
> > Can i put a jpeg as a background for a panel or frame in swing??
> yes, you can, not only jpeg - any image.
>
> public class ImagePanel extends JPanel {
> Image img;
>
> public void paintComponent(Graphics g) {
> Insets insets = getInsets();
> if(img != null) {
> g.drawImage(img, insets.left, insets.top, null);
> }
> }
how do I tell it to locate the jpeg?? in the above code?? Do i just put it
in the same file??
thanks
- Next message: ak: "Re: jpg as background?"
- Previous message: Christopher Wong: "Re: jpg as background?"
- In reply to: ak: "Re: jpg as background?"
- Next in thread: willy: "Re: jpg as background?"
- Reply: willy: "Re: jpg as background?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|