Hi Friends, I would like to place an image as background image in JPanel or paint the background of a JPanel with GradientPaint . My JPanel is acting as input form. Could anybody help me out in this matter.Please this is urgent. Thanks in adv. Sonu [ August 21, 2002: Message edited by: Sonu Ghosh ]
See u can override paintComponent(Graphics g) method of JPanel and in it u can use g.drawImage() method.To show gradientPaint, u can call g.setPaint(GradientPaint) and g.fillRect(x,y,width,height).This should work.TO show the image u can also add a JLAbel of JPanel;s size and set Icon for the JLabel as the Image u want to display
Joined: Jan 23, 2002
Thanks for the suggestion.I managed to do that. This is what I have done
subject: How to put image as background image in JPanel.