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

org.bidib.wizard.mvc.ping.view.PingIntervalRenderer Maven / Gradle / Ivy

There is a newer version: 2.0.29
Show newest version
package org.bidib.wizard.mvc.ping.view;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class PingIntervalRenderer extends DefaultTableCellRenderer {

    private static final long serialVersionUID = 1L;

    public PingIntervalRenderer() {
    }

    @Override
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

        if (value instanceof Integer) {
            int val = ((Integer) value).intValue();
            setText(String.format("%dms", val));
        }
        else {
            setText(null);
        }

        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy