小编jea*_*par的帖子

Java - Jtable颜色

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;

public class Fenetre extends JFrame implements TableCellRenderer {
    private static TableCellRenderer tcr;

    public Fenetre(TableCellRenderer tcr){
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setTitle("Liste des PC de la DTARS");
        this.setSize(500, 250);

        Object[][] data = {
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", "PC Fixe", "xxxx","A REMPLACER","24"},
                {"nomPc", "PC Fixe", "xxxx","A REMPLACER","24"},
                {"nomPc", "PC Portable", "xxxx","OK","NA"},
                {"nomPc", "PC Portable", "xxxx","OK","NA"},
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", "PC Fixe", "xxxx","OK","24"},
                {"nomPc", …
Run Code Online (Sandbox Code Playgroud)

java swing jtable tablecellrenderer

2
推荐指数
1
解决办法
176
查看次数

标签 统计

java ×1

jtable ×1

swing ×1

tablecellrenderer ×1