Java Reference
In-Depth Information
public void
setTitle(String title)
Sets the title for this frame to the argument string.
public void
dispose()
Eliminates the calling frame and all its subcomponents. Any memory they use is released for
reuse. If there are items left (items other than the calling frame and its subcomponents), then
this does not end the program. (The method
dispose
is discussed in Chapter 18.)
public void
setJMenuBar(JMenuBar menubar)
Sets the menu bar for the calling frame.
JMenuItem
See
AbstractButton
.
JPanel
Package:
javax.swing
Ancestor classes:
Object
|
+--Component
|
+--Container
|
+--JComponent
|
+--JPanel
public
JPanel()
Constructor that creates an object of the class
JPanel
.
public
JPanel(LayoutManager manager)
Constructor that creates an object of the class
JPanel
with the given layout manager.
public
Component add(Component componentAdded)
Adds
componentAdded
to the
JPanel
. Typically used as a
void
method.
public void
setBackground(Color c)
Sets the color of the
JPanel
.
public void
setLayout(LayoutManager manager)
Makes
manager
the layout manager for the
JPanel
.