simsima1448
Messages postés3Date d'inscriptionvendredi 25 janvier 2008StatutMembreDernière intervention 5 novembre 2008
-
4 nov. 2008 à 13:22
simsima1448
Messages postés3Date d'inscriptionvendredi 25 janvier 2008StatutMembreDernière intervention 5 novembre 2008
-
5 nov. 2008 à 12:31
: Salut a tous
Je dois ajouter un JScrollPane a un JPanel qui contient un tableau de JTextField mais je ne sais pas comment ajouter le JScrollPane si vous pouvez m'aider voila le code et Merci d'avance
import java.awt.*;
import java.io.*;
import javax.swing.*; // gerer l'interface graphique
import java.awt.event.*;// gérer les evenements
public class GestionTextField extends JFrame
{ //déclaration des variables
private JFrame frameGestion;
private JPanel panelGestion;
private Container cGestion;
private JButton btGestion;
private JLabel lblGestion;
private JTextField txtGestion []= new JTextField[50];;
private int i=20, j=40, k=0;
private JScrollPane jBar; ///////////////////////////////
/*<*><*><*><*><*><*> - Constructeur - <*><*><*><*><*><*><*/
public GestionTextField()
{ //////////Instancier les variables ////////////
frameGestion = new JFrame("Gestion des TextField");
cGestion = frameGestion.getContentPane();
panelGestion = new JPanel();
btGestion = new JButton("Fermer");
lblGestion=new JLabel("Les TextField :");
jBar = new JScrollPane(); /////////////////////////////////////////////
for(i=0;i<50;i++)
{ txtGestion[i] = new JTextField();
txtGestion[i].addActionListener(ajouterTxt);
}
//////// Configurer les composantes /////////
cGestion.setLayout(null);
frameGestion.setBounds(0, 0, 600, 600);