문제

I have a program with the main JFrame and a JDialog. Is there any way to make possible move JToolBar between different jPanels,JFrame,JDialor or any other container?

도움이 되었습니까?

해결책

I don't think this is possible.

After digging around the BasicToolBarUI source, when the toolbar is "floated" from it's original window, a reference to the original parent is maintained (dockingSource). When the toolbar is "dropped" into a frame, this is compared and only an instance of dockingSource is accepted as a valid drop target

The only solution that might work in this case would be to create your own UI delegate and override the functionality of the floating process. This is a lot of work, as you would need to, conceivably, provide a delegate for each possible platform...

The only other choice would be to physically remove and add the toolbar manually

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top