3

Want to use JXLayer to lock up my GUI while some worker thread is executing.Thought that is was as simple as this:

JPanel panel = getMyPanel();       
LockableUI lockableUI = new LockableUI();        
JXLayer l = new JXLayer(panel, lockableUI);        
lockableUI.setLocked(false);
add(l);

first error is that getMyPanel() function is undefined for some reason. i have added the jxlayer3-0.jar

I need the panel that i want to lock.... so if i switch the first line with:

JPanel p =(JPanel) getContentPane();

but then i get the warning that i am adding container's parent to it self.can't find any documentation for JXLayer

caniaskyouaquestion
  • 657
  • 2
  • 11
  • 21
  • 1
    For [example](https://stackoverflow.com/questions/19799451/java-blocking-focus-from-jcomponent/19801009#19801009) as well as [example](http://stackoverflow.com/questions/16623276/swing-delegate-events-to-child-components-of-transformed-parent/16623435#16623435), [example](http://stackoverflow.com/questions/19324918/how-to-disable-all-components-in-a-jpanel/19328368#19328368), [example](http://stackoverflow.com/questions/14324460/rotating-a-jtextfield-vertically/14328881#14328881) – MadProgrammer Dec 15 '14 at 12:33
  • [example](http://stackoverflow.com/questions/12982863/secure-desktop-mode-effect-for-java-application/12983564#12983564), [example](http://stackoverflow.com/questions/25252127/java-rotating-non-square-jpanel-component/25253453#25253453), [example](http://stackoverflow.com/questions/25252127/java-rotating-non-square-jpanel-component/25253453#25253453) – MadProgrammer Dec 15 '14 at 12:34
  • 1
    Some of the examples are locking examples, some are general `JXLayer` examples, some have the examples and libraries linked for easier access, hope they help ;) – MadProgrammer Dec 15 '14 at 12:35
  • @MadProgrammer got it with the help of your examples. it was the case of me understanding that the panel that i want to lock is being added trough JXlayer to the frame...little confusing at first but great !!! – caniaskyouaquestion Dec 15 '14 at 13:32
  • @MadProgrammer is there any good documentation online, can't seem to find any, or is all switched now to JLayer?? Would like to play around with mouse behavior and other stuff with in JXLayer. thanks again – caniaskyouaquestion Dec 16 '14 at 07:29
  • No, the best I can offer is the JLayer implantation in Java 7, but I've not taken a look at it, so I'm not sure how similar they are, and the linked demos and sources in the above examples – MadProgrammer Dec 16 '14 at 08:32
  • @MadProgrammer thanks, will take a look at Jlayer docs, and for JXLayer i will go from what you have already posted. – caniaskyouaquestion Dec 16 '14 at 10:36
  • Make sure you check out the [PBJar demos](https://www.dropbox.com/s/re1hmvypp19oqy1/JXLayer-PBJar-Demo.zip), they contain a bunch of really good extensions (all the rotation demos are based off these) – MadProgrammer Dec 16 '14 at 11:01

1 Answers1

0

To lock some screen elements actually you do not need to wrap your components into something special. Just make use of the glasspane, which exists in every JFrame or JDialog.

Queeg
  • 7,748
  • 1
  • 16
  • 42