i have this code where the container displays a specific background color.
Instead of displaying the color i want to add an image to the background,how should i do it?
public class mark {
public static void main(String[] args) {
// TODO Auto-generated method stub
wmmain m=new mark().new wmmain();
m.setSize(800,500);
m.setVisible(true);
}
class wmmain extends JFrame /* MAIN WINDOW */
{
Container container;
public wmmain()
{
super("Digital Image WaterMarking");
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.out.print("Exit");
System.exit(0);
}
});
container=this.getContentPane();
container.setLayout(new BorderLayout());
container.setBackground(new Color(72, 118, 255));
}
}
}
No comments:
Post a Comment