Java Color Value getColorLabels(Object obj)

Here you can find the source of getColorLabels(Object obj)

Description

get Color Labels

License

Open Source License

Declaration

static List<Field> getColorLabels(Object obj) 

Method Source Code

//package com.java2s;
/*/*  w w w.  j ava2 s  .  c o m*/
 *  $Id: Util.java 288 2008-10-26 13:30:28Z martinlaz $
 *
 *  Author:
 *     Martin Lazarov [mlazarov at sfs.uni-tuebingen.de]
 *     
 *  This file is part of the Gralej system
 *     http://code.google.com/p/gralej/
 *
 *  Gralej is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Gralej is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

import java.lang.reflect.Field;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JLabel;

public class Main {
    static List<Field> getColorLabels(Object obj) {
        List<Field> labs = new LinkedList<Field>();
        for (Field f : obj.getClass().getDeclaredFields()) {
            if (f.getType() == JLabel.class && f.getName().startsWith("_col")) {
                labs.add(f);
            }
        }
        return labs;
    }
}

Related

  1. getBlueGreyColor(Color base)
  2. getBorder(Color clr, int thickness)
  3. getColorBackground()
  4. getColorChooser()
  5. getColorForeground()
  6. getColorTercio(Color a, Color b)
  7. getColorValue(Element element, Object constant)
  8. getDefaultBackgroundColor()
  9. getDefaultBackgroundColor(Color color)