Advertisement
Guest User

Untitled

a guest
Nov 24th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. Button button = new Button("Login");
  2. button.addActionListener(new ActionListener() {
  3. public void actionPerformed(ActionEvent arg0) {
  4.  
  5. String user=(String) textField.getText();
  6. String pass=(String) passwordField_1.getText();
  7.  
  8. try {
  9. Context ctx = new InitialContext();
  10. String appName="";
  11. String moduleName="ProjectLibrary";
  12. String beanName="LB";
  13. String remoteInterface=LibraryRemote.class.getName();
  14. String name="ejb:"+appName+"/"+moduleName+"/"+beanName+"!"+remoteInterface;
  15.  
  16. LibraryRemote proxy=(LibraryRemote) ctx.lookup(name);
  17. if(proxy.RechercheAdmin(user,pass)>0) {
  18. lblProblemInUser1.setVisible(true);
  19.  
  20. }
  21. else {
  22. lblProblemInUser.setVisible(true);
  23.  
  24.  
  25. }
  26.  
  27.  
  28. } catch (Exception e) {
  29. // TODO Auto-generated catch block
  30. e.printStackTrace();
  31.  
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38. }
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement