Dessiner une chaine de caractère en modifiant la police et la taille.


import javax.swing.*;
import java.awt.*;

public class Teste extends JFrame {


public Teste(){
super("teste");
this.setBounds(100,100,200,200);
this.setVisible(true);
}



public static void main(String args[]){
new Teste();
}

public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
Font fonte = new Font("TimesRoman ",Font.BOLD,30);
g2.setFont(fonte);
g2.drawString("bonjour",50,50);
}

}

Laboratoire SUPINFO des technologies Sun
labo-sun@supinfo.com


Conditions d'utilisation et © Copyright SUPINFO International University
23, rue de Château Landon - 75010 PARIS - Tél : +33 (0) 153359700 Fax : +33 (0) 153359701
Respect de la vie privée