Graphics, AWT, Swing II part
I have the following problem: I display a .gif image on a panel with the g.drawIcon()
method. If I now display the image of a car on a track then the background of the
image (black) gets displayed, too.
How can I force java not to draw the background?
I tried the setXORMode(Color col) method which filters the given color out but this
ruins my image.
Answer: Just make your GIF image have a transparent background. Java already
handles drawing GIFs with transparency. The black color in your car image is not the
transparency color of your image.
  
dalal
 Q: I was wondering how to create a Directory Dialog, just like the FileDialog
class, but for selecting directories instead of files.
I m sure this has been done, and I apologize if it is in a FAQ. Just point me in a
direction, and I will go. Swing or AWT is fine.
Answer: In Swing, you can use JFileChooser and set it up to choose a directory. See
the API docs for details.
  
Chris Smith
 Q: Can any one please tell me whether I can create a Window/JFrame in Java
that is not rectangular in shape?
If the answer is yes, then where can I get the information to do that?
Answer: Unfortunately answer is "No"...
(c)1999, 2000, 2001 JavaFAQ.nu. All rights reserved worldwide.
This document is free for distribution, you can send it to everybody who is interested in Java.
This document can not be changed, either in whole or in part
without the express written permission of the publisher.
All questions please 
mailto:info@javafaq.nu
file:///F|/a_jsite/350_tips/graphics II.htm (5 of 5) [2001 07 08 11:24:55]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved