Here you can find the source of createDebugBorder(JComponent c, Color color)
Parameter | Description |
---|---|
c | the component |
color | the border color |
public static void createDebugBorder(JComponent c, Color color)
//package com.java2s; /*/* w w w.ja va 2 s . co m*/ * Copyright 2002-2004 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under */ import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JComponent; public class Main { /** * Useful debug function to place a colored, line border around a component * for layout management debugging. * * @param c * the component * @param color * the border color */ public static void createDebugBorder(JComponent c, Color color) { if (color == null) { color = Color.BLACK; } c.setBorder(BorderFactory.createLineBorder(color)); } }