O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ButtonPanel

WorkDialog provides two methods for adding a button to the button panel—one that takes a string and another that takes a button. Notice that the WorkDialog add methods simply delegate to their enclosed instance of ButtonPanel, so without further ado, let's take a look at the implementation of ButtonPanel in Example 22-3.

Example 22-3. ButtonPanel Class Listing
 import java.awt.*; public class ButtonPanel extends Panel { Panel buttonPanel = new Panel(); Separator separator = new Separator(); public ButtonPanel() { this(Orientation.CENTER); } public ButtonPanel(Orientation orientation) { int buttonPanelOrient = FlowLayout.CENTER; setLayout(new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required