File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Add a background image to a JPanel & JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Add a background image to a JPanel & JTextArea" Watch "Add a background image to a JPanel & JTextArea" New topic
Author

Add a background image to a JPanel & JTextArea

Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
Hello all,
I just am writting a chat program. Like in MSN I want to give the user to change the background of the Text area where they are chatting. In the same time, is it possible to add a background image to a panel. So the interface looks good.
Thank you very much.


SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Carlos Failde
Ranch Hand

Joined: Oct 20, 2000
Posts: 84
Subclass the relevant component and override the paint(Graphics g) method to draw the background image.
An example
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Add a background image to a JPanel & JTextArea
 
Similar Threads
swing
Image in Frame
Background image
add background image in JPANEL
how to add background image to applet