AWT (Abstract Windowing Toolkit) : The AWT Is Roughly Broken Into Three Categories
AWT (Abstract Windowing Toolkit) : The AWT Is Roughly Broken Into Three Categories
AWT (Abstract Windowing Toolkit) : The AWT Is Roughly Broken Into Three Categories
Component
Button Panel
List
Checkbox
TextComponent TextField
TextArea
Component
aFrame.add(aPanel);
Buttons
This class represents a push-button which displays some
specified text.
When a button is pressed, it notifies its Listeners. (More
about Listeners in the next chapter).
To be a Listener for a button, an object must implement the
ActionListener Interface.
aPanel.add(okButton));
aPanel.add(cancelButton));
okButton.addActionListener(controller2);
cancelButton.addActionListener(controller1);
Labels
aPanel.add(aLabel);
List
// 5 rows, 80 columns
TextArea fullAddressTextArea = new TextArea(5, 80);
[…]
North
South
Grid Layout
aPanel.add(new Button("Ok"));
aPanel.add(new Button("Add"));
aPanel.add(new Button("Delete"));
aPanel.add(new Button("Cancel"));
What if I don’t want a LayoutManager?
Ch. VIII - 20
Graphics