button on a frame

What is the easierst way to put buttons on a frame?And do I need a content-pane?
[94 byte] By [EricFalbea] at [2007-11-26 13:28:33]
# 1
on java 5 frame.add.> And do I need a content-pane?With awt no, with swing yes, but the latter versions of the api do not require you do not need to worry about it, and simply use frame.
mlka at 2007-7-7 20:31:31 > top of Java-index,Java Essentials,New To Java...
# 2

> . . . the latter versions of the api do not require you do not need to worry

Does Java allow double negatives?

From the JFrame API:

The JFrame class is slightly incompatible with Frame. Like all other JFC/Swing top-level containers, a JFrame contains a JRootPane as its only child. The content pane provided by the root pane should, as a rule, contain all the non-menu components displayed by the JFrame. This is different from the AWT Frame case. As a conveniance add and its variants, remove and setLayout have been overridden to forward to the contentPane as necessary. This means you can write:frame.add(child);

And the child will be added to the contentPane.

NewB@Foruma at 2007-7-7 20:31:31 > top of Java-index,Java Essentials,New To Java...
# 3
> > . . . the latter versions of the api do not require> you do not need to worry> > Does Java allow double negatives?hey, it was early on xmas morning.
mlka at 2007-7-7 20:31:31 > top of Java-index,Java Essentials,New To Java...