JTabbedPane issue in a nested dockable

Hi all, I am new to DockingFrames. I have a question about the behaviors of JTabbedPane in a nested dockable (I mean a dockable inside another dockable).

I used the EnvironmentDockable from the demo as the parent dockable. Inside the parent dockable I have my MyDefaultSingleCDockable, which extends DefaultSingleCDockable.

	public MyDefaultSingleCDockable(String id, String title,
			Component content) {
		super(id, title, content);
	}
	
	@Override
	public boolean isCloseable() {
		return false;
	}
	
	@Override
	public boolean isExternalizable() {
		return false;
	}
	
	@Override
	public boolean isMaximizable() {
		return true;
	}
	
	@Override
	public boolean isMinimizable() {
		return true;
	}
	
	@Override
	public boolean isStackable() {
		return false;
	}
}```

In the child dockable, I added a JPanel containing a JTabbedPane. As long as I call setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT) for the JTabbedPane, I cannot switch between the tabs. Nothing happens when clicking on the tabs. If I remove setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT), the tabs start working again. 

I have searched the forum, but it seems there is no discussion about the problem. Can anyone help me? Thank you in advance!

I can tell you why there is no discussion. This bug only happens if you set the TabLayoutPolicy and use the framework in a “restricted environment”. Most clients do not run in a restricted environment (only unsigned applets and webstart applications do), except the EnvironmentDockable which forces restricted environment.

As a quick fix you can modify the line “control = new CControl( true );” in EnvironmentDockable, and replace it with “control = new CControl();”.

I’ll have a look into the bug itself, don’t know if/how to fix it yet.

The next version will include a fix, that hopefully does not break all the other applications. I’ll upload the new version Wednesday evening.

Hi Beni,

“control = new CControl();” works for me. Thanks a lot!!