Répondre
Consultez les réponses
Forum Discussion
Messages
consultations et réponses
 

 
Sujet Re: pb d affichage de font de taille 8
Auteur Message de ponthiaux eric le le 05 Aoìt, 2005 à 20:55:21
En
réponses de
pb d affichage de font de taille 8 de tom tom le le 01 Aoìt, 2005 à 19:58:59:

Message
surcharge la methode paint ou paintComponent de ton JTextPane ou JEditorPane de la façon suivante :

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JEditorPane;

public class MyTextPane extends JEditorPane {

public void paint(Graphics g) {


Graphics2D g2 = (Graphics2D)g;

g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);



super.paint(g);
}


Pour + d'info sur les rendering hints java2D

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/RenderingHints.html

bonne continuation ...



Les
réponses
Répondre
Nom :
E-Mail :
Sujet :

Commentaires :