bonjour tout le monde

j'ai créé une classe qui me dessine un ensemble de forme graphique
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
 
import java.awt.*;
import javax.swing.*;
 
public class LinesRectsOvals extends JFrame {
 
   // set window's title bar String and dimensions
   public LinesRectsOvals()
   {
      super( "Drawing lines, rectangles and ovals" );
 
      setSize( 400, 165 );
      setVisible( true );
   }
 
   // display various lines, rectangles and ovals
   public void paint( Graphics g )
   {
      super.paint( g );  // call superclass's paint method
 
      g.setColor( Color.RED );
      g.drawLine( 5, 30, 350, 30 );
 
      g.setColor( Color.BLUE );
      g.drawRect( 5, 40, 90, 55 );
      g.fillRect( 100, 40, 90, 55 );
 
      g.setColor( Color.CYAN );
      g.fillRoundRect( 195, 40, 90, 55, 50, 50 );
      g.drawRoundRect( 290, 40, 90, 55, 20, 20 );
 
      g.setColor( Color.YELLOW );
      g.draw3DRect( 5, 100, 90, 55, true );
      g.fill3DRect( 100, 100, 90, 55, true );
 
      g.setColor( Color.MAGENTA );
      g.drawOval( 195, 100, 90, 55 );
      g.fillOval( 290, 100, 90, 55 );
 
   } // end method paint
 
   // execute application
   public static void main( String args[] )
   {
      LinesRectsOvals application = new LinesRectsOvals();
      application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
   }
 
}

mais quand je fais l'appel de cette classe dans ma classe pricipale
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
new LinesRectsOvals();
les forment apparaissent une fois aprés elles dispparaissent

où est le probleme??