1

I would like to make a JPanel see through the program window like in this picture:

see-through panel

I've tried with setOpacity(false) and setBackground(new Color(0,0,0,0)) but nothing worked so far. Any ideas?

edit:

I've found most of what I needed and managed to make a prototype version of my code, it works as intended (even though I have to deal with a different and ugly look and feel (??)), yet, when i want to make that same transparent panel as part of a tabbed panel it doesn't work, I managed to have my background panel see through, but not my tabbed panel, and I feel like there's a lot of code in the examples that isn't directly related to making it transparent, (probably because I relied on a bit of code from per pixel gradiant transparency or something), I feel there's something I'm missing, using setBackground(new Color(0,0,0,0)) in the constructor works for the default panel, but not for a specific panel, any clue about what i'm doing wrong or missing?

What I aim to do is making a tabbed panel with one that lets you see through the program window.

fen
  • 73
  • 6
  • check this answer: http://stackoverflow.com/questions/10059020/transparent-jpanel – Arlind Hajredinaj Apr 05 '15 at 23:43
  • 1
    doesn't that just repaint what's behind the panel instead of showing the desktop/window behind the porgram's window? – fen Apr 05 '15 at 23:54
  • More examples [here](http://stackoverflow.com/a/11705029/2891664) and [here](http://stackoverflow.com/a/14928212/2891664). – Radiodef Apr 06 '15 at 00:07
  • Since @headfime tried to post an answer that is just a link, which StackOverflow doesn't like, but since he also is probably unable to post comments, here's the link he was trying to direct you to: Check out [this Oracle tutorial](https://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html), especially the 2nd example there. – ajb Apr 06 '15 at 00:22
  • thanks, sorry about the duplicate – fen Apr 06 '15 at 09:56

0 Answers0