Java Swing Border drawBorderWhite(Graphics2D g, JComponent focusOwner, JComponent area)

Here you can find the source of drawBorderWhite(Graphics2D g, JComponent focusOwner, JComponent area)

Description

draw Border White

License

Open Source License

Declaration

public static void drawBorderWhite(Graphics2D g, JComponent focusOwner, JComponent area) 

Method Source Code


//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 drawBorderWhite(Graphics2D g, JComponent focusOwner, JComponent area) {

        g.setColor(new Color(255, 255, 255));
        g.drawRect(0, 0, area.getWidth() - 1, area.getHeight() - 1);
        g.drawRect(1, 1, area.getWidth() - 3, area.getHeight() - 3);

        if (focusOwner != null && focusOwner.isFocusOwner()) {
            g.setColor(new Color(240, 240, 240));
            g.drawRect(0, 0, area.getWidth() - 1, area.getHeight() - 1);
            g.drawRect(1, 1, area.getWidth() - 3, area.getHeight() - 3);
        }/*  www .ja va2 s .  com*/

    }
}

Related

  1. createRightBorder(int size, Color color)
  2. createRoundedEmptyBorder(final int top, final int left, final int bottom, final int right, final int arc, final Color color)
  3. createTitledBorder(Color color, String name)
  4. createVerticalBox(Border border, Component... comps)
  5. drawBorderTrans(Graphics2D g, JComponent focusOwner, JComponent area)
  6. drawDisabledBorder(Graphics g, int x, int y, int w, int h)
  7. drawDisabledBorder(Graphics g, int x, int y, int w, int h)
  8. extendByBorder(JLabel label, Dimension dm)
  9. findComponentWithBorder(JComponent panel, Class aClass)