Hello le forum,

j'ai un programme qui envoie à un jTextArea du texte en continu. Il s'agit d'afficher le trafic sur un serveur.

J'ai donc une classe qui affiche ce flux :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
    public FlowFrame(String name, String flow) {
        super();
 
        //Settings.
        this.setSize(550, this.getToolkit().getScreenSize().height-50); //Give the size of the frame.
        this.setTitle(name);
        this.setDefaultCloseOperation(FlowFrame.DISPOSE_ON_CLOSE);
 
        this.flowArea = new JTextArea();
        this.flowArea.setFont(new Font("Arial", 0, 11));
        this.flowArea.setText(flow);
 
        //Put the flow text area in a scrollpane.
        this.scrollPanel = new JScrollPane();      
        this.scrollPanel.setViewportView(this.flowArea);
 
        //Create a clear button.
        this.clearButton = new JButton(Constants.CLEAR);
 
        //Create a follow button.
        this.followButton = new JButton(Constants.UNFOLLOW);
 
        //Create an exit button.
        this.exitButton = new JButton(Constants.EXIT);
 
        //Construct the panel containing the buttons.
        FlowLayout flowLayout1 = new FlowLayout();
        flowLayout1.setHgap(20);
        JPanel buttonPanel = new JPanel(flowLayout1);
 
        //Construct a panel for two buttons.
        FlowLayout flowLayout2 = new FlowLayout();
        flowLayout2.setHgap(100);
        JPanel buttonSubpanel = new JPanel(flowLayout2);
 
        //Add the button to the subpanel.
        buttonSubpanel.add(this.clearButton);
        buttonSubpanel.add(this.followButton);
 
        //Add all the buttons to the panel buttons.
        buttonPanel.add(buttonSubpanel);
        buttonPanel.add(this.exitButton);
 
        //Add the panel buttons and the flow area to the frame.
        this.getContentPane().add(BorderLayout.SOUTH, buttonPanel);
        this.getContentPane().add(BorderLayout.CENTER, this.scrollPanel);
 
        this.setVisible(true);
    }
Cependant, sur certain serveur le texte qui m'est revoyé est mis en forme et l'affichage ne prend pas en compte certains caractères : \b, <ESC>[^, ...
J'aimerai que ma fenêtre affiche la mise en forme comme si s'était une fenêtre de putty par exemple.

Merci de votre coup de main,
Bap