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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to put image as background image in JPanel.