Bonjour,

Voici la classe suivante :

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
package pages.historique.excel;

import jxl.format.Alignment;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;

public class GlobalExcel
{
    private static final WritableFont.FontName STANDARD_FONT_NAME = WritableFont.ARIAL;
    
    private static final Integer STANDARD_FONT_SIZE = 12;
        
    public static WritableCellFormat FORMAT_TH = null;
    
    static
    {
        try
        {
            initFORMAT_TH();
        }
        catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    
    public static void initFORMAT_TH() throws Exception
    {
        FORMAT_TH = new WritableCellFormat(new WritableFont(STANDARD_FONT_NAME, STANDARD_FONT_SIZE, WritableFont.BOLD, false));
        
        FORMAT_TH.setAlignment(Alignment.CENTRE);
    }
    
}
Mais en faisant comme cela je ne peux pas faire :

- Déclarer FORMAT_TH en final
- Récupérer l'exception dans l'application appelante

Comment organiser cette classe ?

Merci.