Hi all!
I am creating an application that contains a CardLayout, which is changed from a “Card” to another using a few buttons.
On each card, I want to add a ContentArea, and each containing its dockable ContentArea. Each Dockable can change from one card to another, coupled with the other dockable that already exist in it.
I have a CControl unique, and every time I create a new card, I add a new CContentArea to CControl. This is the code:
final CControl control = new CControl(frame);
final CustomMultiFactory factory = new CustomMultiFactory();
control.addMultipleDockableFactory("custom", factory);
Random random = new Random();
CustomMultiDockable dockable = new CustomMultiDockable(factory, "Panel " + this.numPanels,
new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255)));
CContentArea area = control.createContentArea("Panel " + this.numPanels);
cardPanel.addPanel(area, "Panel " + this.numPanels);
CGrid grid = new CGrid(control);
grid.add(0, 0, 1, 1, dockable);
area.deploy(grid);
this.numPanels++;
But I have the following problems:
-If I do a drag & drop dockable to change this in ContentArea, then remove the card that contains the origin ContentArea, The Dockable is removed from the destination card.
Can definitely change ContentArea?
Do I need a different distribution of the components? currently working with: 1 CControl, N ContentArea, N MultiDocker.
How I can access a Dockable, a CContentArea or CStation from a CControl instance?
I hope I can help! If you need more information, let me know.
Thank you very much for everything!
Greetings! (Sorry for my English!)