Exemplo n.º 1
0
 @Override
 public void defineTitle(Canvas canvas, String title) {
   canvas.setTitle(title);
   if (canvas.getFrame().getFrame() != null) {
     canvas.getFrame().getFrame().setTitle(title);
   }
 }
Exemplo n.º 2
0
  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);
  }
Exemplo n.º 3
0
 @Override
 public Canvas createCanvas(String title) {
   Canvas canvas = new Canvas(new FrameWrapper());
   canvas.setTitle(title);
   return canvas;
 }
Exemplo n.º 4
0
 @Override
 public Canvas createCanvas() {
   Canvas canvas = new Canvas(new FrameWrapper());
   canvas.setTitle("Graphic output");
   return canvas;
 }