Here you can find the source of drawBorderTrans(Graphics2D g, JComponent focusOwner, JComponent area)
public static void drawBorderTrans(Graphics2D g, JComponent focusOwner, JComponent area)
//package com.java2s; //License from project: Open Source License import java.awt.Color; import java.awt.Graphics2D; import javax.swing.JComponent; public class Main { public static void drawBorderTrans(Graphics2D g, JComponent focusOwner, JComponent area) { if (focusOwner != null && focusOwner.isFocusOwner()) { g.setColor(new Color(180, 180, 180)); g.drawRect(0, 0, area.getWidth() - 1, area.getHeight() - 1); }/*from ww w . ja va 2 s . c o m*/ } }