Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public IQuestion connectClient() {
  2. try {
  3. // Objekt über den Namensdienst auf dem Server suchen
  4. Registry registryTed = LocateRegistry.getRegistry(mClientPanel
  5. .getMTfConnect().getText());
  6. @SuppressWarnings("unused")
  7. IQuestion mTedQuestion = (IQuestion) registryTed.lookup("TED");
  8. System.out.println("1: " + mTedQuestion.toString());
  9.  
  10. // Bei erfolgreicher Verbindung Pop-up "HINWEIS" & Methodenaufruf
  11. // zum aktiveren/deaktivieren der GUI Elemente
  12. Component parentComponent = null;
  13. JOptionPane.showMessageDialog(parentComponent, "Verbunden mit "
  14. + mClientPanel.getMTfConnect().getText(), "HINWEIS",
  15. JOptionPane.INFORMATION_MESSAGE);
  16. mClientPanel.enable();
  17. return mTedQuestion;
  18. } catch (Exception e) {
  19. // Bei fehlgeschlagener Verbindung Pop-up "FEHLER"
  20. Component parentComponent = null;
  21. JOptionPane.showMessageDialog(parentComponent, mClientPanel
  22. .getMTfConnect().getText()
  23. + " konnte nicht gefunden werden", "FEHLER!",
  24. JOptionPane.ERROR_MESSAGE);
  25. }
  26. System.out.println("hier");
  27. return mTedQuestion;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement