Package java.awt

Examples of java.awt.Frame.createImage()


   * @return FontMetrics for a font
   */
  public FontMetrics getFontMetrics(Font font) {
    Frame dummy = new Frame();
    dummy.addNotify();
    Image image = dummy.createImage(100, 100);
    if (image == null) {
      System.err.println("getFontMetrics: image is null");
    }
    Graphics graphics = image.getGraphics();
    return graphics.getFontMetrics(font);
View Full Code Here


      // Create an unshown frame
      frame = new Frame();
      frame.addNotify();

      // Get a graphics region, using the Frame
      Image image = frame.createImage(300, 200);
      // image size width 300, height 200
      g = image.getGraphics();

      g.setColor(new Color(0x0040FF));
      g.setFont(new Font("System", Font.PLAIN, 11));
View Full Code Here

      // Create an unshown frame
      frame = new Frame();
      frame.addNotify();

      // Get a graphics region, using the Frame
      Image image = frame.createImage(200, 300);
      // image size width 200, height 300
      g = image.getGraphics();

      g.setFont(new Font("Serif", Font.ITALIC, 50));
      g.drawString("JSP", 10, 50);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.