This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi Big Moose Guys!
I tried some transparency with JTabbedPane using this:
Color alphaZero = new Color (204,204,204,32); // light gray = 204,204,204; 32 = 1/8 opaque or 7/8 transparent
// The following 2 lines generates a well done semi-transparency in header (tabs) of JTabbedPane produtoFrm.getjTabbedPane1().setOpaque(false); // tabs (3)
produtoFrm.getjTabbedPane1().setBackground(alphaZero); // this works well, 3 tabs semi-transparents
// But the background of panels still opaque, even trying the following code...
produtoFrm.getjScrollPane2().setOpaque(false);
produtoFrm.getjScrollPane2().getViewport().setBackground(alphaZero);
produtoFrm.getjScrollPane3().setOpaque(false);
produtoFrm.getjScrollPane3().getViewport().setBackground(alphaZero);
produtoFrm.getjScrollPane4().setOpaque(false);
produtoFrm.getjScrollPane4().getViewport().setBackground(alphaZero);
What is wrong or missing? (obs - i don´t use look and feel)
Thank you very much, guys and gals!
don't know if it's changed in java 7, but for 6 you would set your own ui (tabbedPane.setUI(...)),
overriding paintContentBorder(...) to do nothing
Nilton Castro
Greenhorn
Joined: Dec 15, 2012
Posts: 12
posted
0
Thanks for the quick response. But please, no offense, look down and see my low level. In Portuguese, UI (pronounced OOEE) means OUCH. I'm still pretty new to java, I'm trying very hard but I am ignorant. So if possible, you can stretch the "(...)" so I can understand? No joke, no offense, I'm stupid even.
I really appreciate you expend your time with me, do you have a little bit more? Thank you very much!
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
1
this will be transparent, so you may need to add an intermediary panel with your semi-transparent background
Nilton Castro
Greenhorn
Joined: Dec 15, 2012
Posts: 12
posted
0
Thank you very much Michael Dunn! I will give a try (don´t forget, UI = OUCH in portuguese).
Nilton Castro
Greenhorn
Joined: Dec 15, 2012
Posts: 12
posted
0
Hello good Michael Dunn!
The solution you presented yesterday worked very well, as shown in the attached image. I'm learning java from myself and when I understood what "listerners" means and how they work i realized that Java is not just a ordinary language, it is an engine (such as game engines) and it is very close to how an operating system works and this is a huge breakthrough for an ordinary language. So, as I said yesterday, I'm a complete ignorant, trying to learn something ... Until yesterday I thought Java was a beautiful woman from afar and, up close, a wild cat. Today I think Java is a beautiful woman from afar and up close, a beautiful woman too hot.
Thank you for taking your time to help people like me from underground.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.