setFont ne semble pas fonctionner
Bonsoir,
Je n'arrive pas à faire fonctionner la méthode setFont. A chaque fois que je change les paramètres, aucun changement n'est visible à l'écran...
Ou ai-je fait une erreur?
Merci d'avance.
Nico'
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
public class Toto {
Object[][] donnees = {
{"Swing", "Astral"},
{"Swing", "Mistral"},
} ;
String[] titreColonnes = { "modèle", "marque"};
public Toto() {
System.out.println("Début Toto()");
JFrame jf = new JFrame();
JTable jTable1 = new JTable(donnees, titreColonnes);
jf.getContentPane().setFont(new Font("SansSerif",Font.PLAIN,58));
jf.getContentPane().add(jTable1);
jf.setVisible(true);
}
public static void main(String[] args) {
System.out.println("Début main");
Toto tata = new Toto();
}
} |