Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 3rd, 2007, 08:40 AM
fipi fipi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 1 fipi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 48 sec
Reputation Power: 0
How do i do transparency in java?

Hi everyone, i'm having a problem with color transparency in java. I'm trying to make a semi-transparent color layer over the rest of the drawn things in a JPanel. I'm using double-buffering, so in a method render() I set a Graphics2D's color to a partially transparent color like this:
g2d.setColor(new Color(200,100,100, 100))
(The first three arguments are the RGB values, and the last one is the alpha value). Then i drew a filled rectangle over my buffer Image. In paintComponent(Graphics g), that Image is drawn onto the JPanel.
However, when the program runs, instead of a semi-transparent color over the rest of the JPanel's contents, it draws strange blocky colors... sorry if i'm not very specific :P
Anyways does anyone know how to do this right?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > How do i do transparency in java?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT