Adding a border to a Swing component is an example of which design pattern?
In the sample program of Section 5.8, the Bundle
class is an example of which design pattern?
Not everything that is strategic is an instance of the STRATEGY pattern. Which conditions must be fulfilled? Check all that apply.
Scanner
can be used to read numbers and lines from a Reader
. Is this an example of the DECORATOR pattern?panel.setBorder(new TitledBorder(new EtchedBorder(), "Select one option"));
TitledBorder
class.CompositeIcon
that implements the Icon
interface type and contains a list of icons. Supply a method void addIcon(Icon icon). Draw the icons in a horizontal row.
import javax.swing.*; public class IconTester { public static void main(String[] args) { Icon compositeIcon = new CompositeIcon(); compositeIcon.addIcon(new MarsIcon(50)); compositeIcon.addIcon(new ImageIcon("globe.gif")); JOptionPane.showMessageDialog( null, "Hello, Composite!", "Message", JOptionPane.INFORMATION_MESSAGE, compositeIcon); System.exit(0); } }