@Override public void defineTitle(Canvas canvas, String title) { canvas.setTitle(title); if (canvas.getFrame().getFrame() != null) { canvas.getFrame().getFrame().setTitle(title); } }
public static void main(String[] args) { Canvas canvas = new Canvas(); canvas.setTitle("canvas sample"); canvas.setSize(600, 200); canvas.setLocationRelativeTo(null); canvas.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); CanvasData dd = new CanvasData(300); NewPanel p = new NewPanel(dd); canvas.add(p); canvas.setVisible(true); }
@Override public Canvas createCanvas(String title) { Canvas canvas = new Canvas(new FrameWrapper()); canvas.setTitle(title); return canvas; }
@Override public Canvas createCanvas() { Canvas canvas = new Canvas(new FrameWrapper()); canvas.setTitle("Graphic output"); return canvas; }