-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finished formation, and made the ajout etudiant interface 1st version
- Loading branch information
1 parent
16fa81d
commit 466a562
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package ExercicesTP.CRUD; | ||
import ExercicesTP.Etudiant; | ||
import ExercicesTP.interfaces.EtudiantDaoCRUD; | ||
public class EtudiantDAO implements EtudiantDaoCRUD{ | ||
|
||
@Override | ||
public void addEtudiant(Etudiant etudiant) { | ||
|
||
} | ||
|
||
@Override | ||
public void deleteEtudiant(int id) { | ||
|
||
} | ||
|
||
@Override | ||
public void updateEtudiant(Etudiant etudiant) { | ||
|
||
} | ||
|
||
@Override | ||
public Etudiant getEtudiant(int id) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Etudiant[] getAllEtudiants() { | ||
return new Etudiant[0]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package ExercicesTP.IHM; | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class IHMAjoutEtudiant extends JInternalFrame{ | ||
public JLabel nomLabel, prenomLabel, numEtdLabel, filiereLabel, niveauLabel, groupeLabel; | ||
public JTextField nomField, prenomField, numEtdField; | ||
public JComboBox<String> filiereComboBox; | ||
public JComboBox<Integer> niveauComboBox, groupeComboBox; | ||
|
||
public JButton addButton, cancelButton; | ||
public IHMAjoutEtudiant(){ | ||
setTitle("Ajout d'un étudiant"); | ||
setSize(400, 400); | ||
initializeComponents(); | ||
createLayout(); | ||
//addEventListeners(); | ||
setVisible(true); | ||
} | ||
private void addComponent(JPanel panel, JComponent component, GridBagConstraints c, int x, int y, int width, int height) { | ||
c.gridx = x; | ||
c.gridy = y; | ||
c.gridwidth = width; | ||
c.gridheight = height; | ||
panel.add(component, c); | ||
} | ||
public void initializeComponents() { | ||
nomLabel = new JLabel("Nom :"); | ||
prenomLabel = new JLabel("Prénom :"); | ||
numEtdLabel = new JLabel("Numéro étudiant :"); | ||
filiereLabel = new JLabel("Filière :"); | ||
niveauLabel = new JLabel("Niveau :"); | ||
groupeLabel = new JLabel("Groupe :"); | ||
|
||
nomField = new JTextField(15); | ||
prenomField = new JTextField(20); | ||
numEtdField = new JTextField(15); | ||
|
||
// Sample data for comboboxes (replace with actual data source) | ||
filiereComboBox = new JComboBox<>(new String[]{"FIA", "Licence Sc Info", "Licence Info de Gest", "Maths Info", "Physique Info", "Chimie Info", "Bio Info", "Eco Info", "Génie Info", "Info de Gestion", "Info de Comm"}); | ||
niveauComboBox = new JComboBox<>(new Integer[]{1, 2, 3}); | ||
groupeComboBox = new JComboBox<>(new Integer[]{1, 2, 3, 4, 5}); | ||
|
||
addButton = new JButton("Ajouter"); | ||
cancelButton = new JButton("Annuler"); | ||
|
||
} | ||
|
||
public void createLayout() { | ||
JPanel panel = new JPanel(new GridBagLayout()); | ||
GridBagConstraints c = new GridBagConstraints(); | ||
|
||
// Add labels and corresponding components | ||
c.fill = GridBagConstraints.HORIZONTAL; | ||
addComponent(panel, numEtdLabel, c, 0, 2, 1, 1); | ||
addComponent(panel, numEtdField, c, 1, 2, 2, 1); | ||
addComponent(panel, nomLabel, c, 0, 0, 1, 1); | ||
addComponent(panel, nomField, c, 1, 0, 2, 1); | ||
addComponent(panel, prenomLabel, c, 0, 1, 1, 1); | ||
addComponent(panel, prenomField, c, 1, 1, 2, 1); | ||
addComponent(panel, filiereLabel, c, 0, 3, 1, 1); | ||
addComponent(panel, filiereComboBox, c, 1, 3, 2, 1); | ||
addComponent(panel, niveauLabel, c, 0, 4, 1, 1); | ||
addComponent(panel, niveauComboBox, c, 1, 4, 2, 1); | ||
addComponent(panel, groupeLabel, c, 0, 5, 1, 1); | ||
addComponent(panel, groupeComboBox, c, 1, 5, 2, 1); | ||
addComponent(panel, addButton, c, 0, 6, 1, 1); | ||
addComponent(panel, cancelButton, c, 1, 6, 1, 1); | ||
add(panel); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters