Re: jpg as background?
From: ak (spam_at_imagero.com)
Date: 12/27/03
- Next message: ak: "Re: Thumbnail view with Swing ?"
- Previous message: Abs: "Thumbnail view with Swing ?"
- In reply to: Evil Monkey: "jpg as background?"
- Next in thread: Evil Monkey: "Re: jpg as background?"
- Reply: Evil Monkey: "Re: jpg as background?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Dec 2003 21:43:17 +0100
> 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);
}
}
}
> Could I make it the background of my frame and set the panel to opaque?
yes
> would this effect and animation?
for animation you need more then one image.
____________
http://reader.imagero.com the best java image reader.
- Next message: ak: "Re: Thumbnail view with Swing ?"
- Previous message: Abs: "Thumbnail view with Swing ?"
- In reply to: Evil Monkey: "jpg as background?"
- Next in thread: Evil Monkey: "Re: jpg as background?"
- Reply: Evil Monkey: "Re: jpg as background?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|