Semi-transparent overlay on SplitPane

Discuss here any questions about the WebLaF library.
Bugs can be posted directly to GitHub issues tracker.

Semi-transparent overlay on SplitPane

Postby StepTNT » Mon Jun 01, 2015 8:47 pm

I'm trying to add an overlay to a SplitPane, but the results are weird (the SplitPane is rendered with a strange offset instead of starting from (0,0)).
I also have issues when the overlay should be hidden, because I can't see the SplitPane (plain grey background and nothing shown).

Here's a screenshot of what happens when I show the overlay:
wrongRes.png
wrongRes.png (76.48 KiB) Viewed 2258 times


Of course I'd like to have the SplitPane shown correctly with just the overlay over it.

This is my JFrame's outline:
docOutline.png
docOutline.png (4.36 KiB) Viewed 2258 times


Finally, I'm showing/hiding the outline with this code:

Code: Select all
if (enabled){
    mainPanelContainer.remove(indexerOverlay);
    mainPanelContainer.setVisible(false);
} else {                     
    mainPanelContainer.setVisible(true);
    mainPanelContainer.add(indexerOverlay, SwingConstants.CENTER, SwingConstants.CENTER); 
    mainPanelContainer.setComponentZOrder(indexerOverlay, 0);
}


Now, the code may be wrong but this is the only combination that showed some results. Without remove/add it doesn't show up.

Any hints on this?
StepTNT
 
Posts: 1
Joined: Mon Jun 01, 2015 8:36 pm

Re: Semi-transparent overlay on SplitPane

Postby mgarin » Fri Jun 05, 2015 3:36 am

It looks like you are trying to switch/hide some portions of UI by changing visibility which might not actually work the way you expect it to. I cannot really say anything else about this problem without seeing the whole code - it would all be guesses.

Also it would be nice if you can provide an SSCCE representing this issue.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron