×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Wissam Lefevre
Added: May 25, 2015 9:04 PM
Views: 9
Tags: no tags
  1. package ProjetLisa;
  2.  
  3. import java.awt.*;
  4. import java.awt.event.*;
  5. import javax.swing.*;
  6. import java.io.File;
  7. import static ProjetLisa.Constante.*;
  8.  
  9.  
  10. public class ListeClasse extends JPanel {
  11.  
  12.     private BorderLayout l = new BorderLayout();
  13.    
  14.     private String[] listeClasse;
  15.     private File sourceClasses = new File("src/Classes");
  16.     private JList<String> jl1;
  17.  
  18.     public ListeClasse() {
  19.  
  20.         setLayout(l);
  21.         listeClasse = sourceClasses.list();
  22.        
  23.        
  24.         jl1 = new JList<>(listeClasse);
  25.         jl1.setFont(new Font(Font.SERIF, Font.BOLD, 40));
  26.         jl1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  27.  
  28.        
  29.         // Adds
  30.         add("North", labelDate);
  31.         add("Center", jl1);
  32.     }
  33. }
  34.