0

I have a JTable, I would like to change the color of the text that is shown in the cells. I've tried multiple solutions but none have worked so far.

Here is a screen of a part of my table : http://www.noelshack.com/2015-32-1438953654-table.png

Here is the last thing i tried :

    private JLabel lab;
    case 1:
        // System.out.println(langue);
        if (langue.equals("FR")) {
            // I'm getting the values of my BDD inside paystitre
            String paystitre = push.get(indiceLigne).getPays() + " : " + push.get(indiceLigne).getTitrefr();
            lab = new JLabel();
            lab.setText(paystitre);
            lab.setForeground(Color.BLUE);
            // the text that is shown as 'Text Exemple' on the screenshot.
            String paysEtTitre = lab.getText(); 

            return paysEtTitre;
        } 
}

Do you have an idea how I could get "Text Exemple" painted in red for exemple?

0 Answers0