Question: import javax.swing. * ; public class Application { public static void main ( String [ ] args ) { JFrame frame = new Frame (
import javax.swing.;
public class Application
public static void mainString args
JFrame frame new FrameSwing App";
frame.setDefaultCloseOperationJFrameEXITONCLOSE;
frame.setSize;
IComponent Component new ComponentImpl;
GUIBooster adapter new GUIBoosterComponent;
frame.getContentPaneaddadapter;
frame.setVisibletrue;
public class ComponentImpl implements IComponent
@Override
public void draw
System.out.printlnComponent is drawn";
import javax.swing.;
public class GUIBooster extends JPanel
private final IComponent Component;
public GUIBoosterIComponent Component
this.Component Component;
@Override
protected void paintComponentjavaawt.Graphics g
super.paintComponentg;
Component.draw;
public interface IComponent
void draw;
Which design pattern is used?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
