Here you can find the source of drawBubble(BufferedImage img, Graphics g, Component component)
public static void drawBubble(BufferedImage img, Graphics g, Component component)
//package com.java2s; //License from project: Apache License import java.awt.Component; import java.awt.Graphics; import java.awt.image.BufferedImage; public class Main { public static void drawBubble(BufferedImage img, Graphics g, Component component) { // header g.drawImage(img.getSubimage(0, 0, 31, 31), 0, 0, 14, 14, null); g.drawImage(img.getSubimage(31, 0, 10, 31), 14, 0, component.getWidth() - 14 - 14, 14, null); g.drawImage(img.getSubimage(img.getWidth() - 31, 0, 31, 31), component.getWidth() - 14, 0, 14, 14, null); // body//from ww w .j a v a 2 s . c om g.drawImage(img.getSubimage(0, 31, 31, img.getHeight() - 31 - 25), 0, 14, 14, component.getHeight() - 14 - 14, null); g.drawImage(img.getSubimage(31, 31, 5, img.getHeight() - 31 - 25), 14, 14, component.getWidth() - 14 - 14, component.getHeight() - 14 - 14, null); g.drawImage(img.getSubimage(img.getWidth() - 25, 31, 25, img.getHeight() - 31 - 25), component.getWidth() - 14, 14, 14, component.getHeight() - 14 - 14, null); // footer g.drawImage(img.getSubimage(0, img.getHeight() - 25, 33, 25), 0, component.getHeight() - 14, 14, 14, null); g.drawImage(img.getSubimage(40, img.getHeight() - 25, 5, 25), 14, component.getHeight() - 14, component.getWidth() - 14 - 14, 14, null); g.drawImage(img.getSubimage(img.getWidth() - 28, img.getHeight() - 28, 28, 28), component.getWidth() - 14, component.getHeight() - 14, 14, 14, null); } }