JesuisEva

week4

Dec 16th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. Scherm1
  2. ----------------------------------------------------------------------------------------------------------
  3. private void infoButtonActionPerformed(java.awt.event.ActionEvent evt) {
  4.  
  5. String Selectie = list.getSelectedValue().toString();
  6.  
  7. String[] naam = Selectie.split(" ");
  8. String voornaam = naam[0];
  9. String achternaam = naam[1];
  10.  
  11. Infoscherm info = new Infoscherm(voornaam, achternaam, infoscherm);
  12. info.setVisible(true);
  13.  
  14. try {
  15. Connection con = Week4.getConnection();
  16. Statement stmt = con.createStatement();
  17. String SQL = "SELECT * FROM lid WHERE naam = '"+voornaam+"', '"+achternaam+"'";
  18. ResultSet result = stmt.executeQuery(SQL);
  19.  
  20. result.next();
  21.  
  22. info.projectnaamVeld.setText(result.getString(1));
  23. info.startdatumVeld.setText(result.getString(2));
  24. info.einddatumVeld.setText(result.getString(3));
  25. info.leiderVeld.setText(result.getString(4));
  26. //info.lidVeld.setListData(result.getString(5));
  27. //info.lidVeld.setText(result.getString(5));
  28. info.inexVeld.setText(result.getString(6));
  29. info.typeVeld.setText(result.getString(7));
  30. info.omschrijvingVeld.setText(result.getString(8));
  31.  
  32. } catch (SQLException err) {
  33. System.out.println(err.getMessage());
  34. }
  35.  
  36. list.setListData(projecten.toArray());
  37.  
  38. }
  39.  
  40. scherm 2
  41. -----------------------------------------------------------------------------------------------------------
  42.  
  43. public class Infoscherm extends javax.swing.JFrame {
  44.  
  45. public String voornaam;
  46. public String achternaam;
  47. public Infoscherm info;
  48.  
  49. public Infoscherm(String voornaam, String achternaam, Infoscherm infoscherm) {
  50. initComponents();
  51. this.voornaam = voornaam;
  52. this.achternaam = achternaam;
  53. this.info = info;
  54. }
  55.  
  56. public Infoscherm() {
  57. initComponents();
  58.  
  59. ButtonGroup inex = new ButtonGroup();
  60. inex.add(internRadio);
  61. inex.add(externRadio);
  62.  
  63. ButtonGroup type = new ButtonGroup();
  64. type.add(cRadio);
  65. type.add(javaRadio);
  66. type.add(phpRadio);
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment