This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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