private void test() { MyGraphics mg = new MyGraphics(); ToolBarBorder border = new ToolBarBorder(); border.paintBorder(mg.component, mg, 0, 0, 10, 10); if (mg.image != null) { boolean failed = true; int value = mg.image.getRGB(0, 0); for (int x = 0; x < mg.image.getWidth(); x++) { for (int y = 0; y < mg.image.getHeight(); y++) { int current = mg.image.getRGB(x, y); if (current != value) { mg.image.setRGB(x, y, value); failed = false; } } } if (failed) { throw new Error("shared metal bumps"); } } }