AnsweredAssumed Answered

Why we need cardPanel in Workspace?

Question asked by wroot Champion on Oct 14, 2010

Moving from document by Michael Tan

 

Recently I do the research for the Spark source code. And I find an interesting variable in Workspace class: cardPanel.  cardPanel is an instance of JPanel, and Workspace itself also extends  JPanel. Actually MainWindow should include three panels: statusBox,  commandPanel and workspace. And we can find this line code:

 

cardPanel.add(WORKSPACE_PANE, this);

 

This means the cardPanel just adds Workspace as its component, in fact Workspace is cardPanel's only one component.

 

So  why we need cardPanel? I can't find the use of it. Because we can use  workspace instead. Could you tell me why we need cardPanel? Thanks!

Outcomes