42 |
import java.awt.Component; |
import java.awt.Component; |
43 |
import java.awt.Container; |
import java.awt.Container; |
44 |
import java.awt.Dimension; |
import java.awt.Dimension; |
45 |
|
import java.awt.IllegalComponentStateException; |
46 |
import java.awt.LayoutManager; |
import java.awt.LayoutManager; |
47 |
import java.awt.LayoutManager2; |
import java.awt.LayoutManager2; |
48 |
import java.io.Serializable; |
import java.io.Serializable; |
405 |
} |
} |
406 |
|
|
407 |
/** |
/** |
408 |
* DOCUMENT ME! |
* Sets the JRootPane's content pane. The content pane should typically be |
409 |
|
* opaque for painting to work properly. This method also |
410 |
|
* removes the old content pane from the layered pane. |
411 |
* |
* |
412 |
* @param p DOCUMENT ME! |
* @param p the Container that will be the content pane |
413 |
|
* @throws IllegalComponentStateException if p is null |
414 |
*/ |
*/ |
415 |
public void setContentPane(Container p) |
public void setContentPane(Container p) |
416 |
{ |
{ |
417 |
contentPane = p; |
if (p == null) |
418 |
getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); |
throw new IllegalComponentStateException ("cannot " + |
419 |
|
"have a null content pane"); |
420 |
|
else |
421 |
|
{ |
422 |
|
if (contentPane != null && contentPane.getParent() == layeredPane) |
423 |
|
layeredPane.remove(contentPane); |
424 |
|
contentPane = p; |
425 |
|
getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER); |
426 |
|
} |
427 |
} |
} |
428 |
|
|
429 |
/** |
/** |