All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.maizegenetics.gui.RowHeaderRenderer Maven / Gradle / Ivy

Go to download

TASSEL is a software package to evaluate traits associations, evolutionary patterns, and linkage disequilibrium.

The newest version!
/*
 */
package net.maizegenetics.gui;

import java.awt.Component;
import javax.swing.BorderFactory;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.table.JTableHeader;

/**
 *
 * @author terry
 */
public class RowHeaderRenderer extends JLabel implements ListCellRenderer {

    public RowHeaderRenderer(JTable table) {
        JTableHeader header = table.getTableHeader();
        setOpaque(true);
        setBorder(UIManager.getBorder("TableHeader.cellBorder"));
        setHorizontalAlignment(CENTER);
        setForeground(header.getForeground());
        setBackground(header.getBackground());
        setFont(header.getFont());
        setBorder(BorderFactory.createEtchedBorder());
    }

    public Component getListCellRendererComponent(JList list,
            Object value, int index, boolean isSelected, boolean cellHasFocus) {
        setText((value == null) ? "" : value.toString());
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy