Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. public class Counselling extends JFrame {
  2.  
  3. private JPanel contentPane;
  4.  
  5. /**
  6. * Launch the application.
  7. */
  8. public static void main(String[] args) {
  9. EventQueue.invokeLater(new Runnable() {
  10. public void run() {
  11. try {
  12. Counselling frame = new Counselling();
  13. frame.setVisible(true);
  14. } catch (Exception e) {
  15. e.printStackTrace();
  16. }
  17. }
  18. });
  19. }
  20.  
  21. /**
  22. * Create the frame.
  23. */
  24. public Counselling() {
  25. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  26. setBounds(100, 100, 510, 450);
  27. contentPane = new JPanel();
  28. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  29. setContentPane(contentPane);
  30. contentPane.setLayout(null);
  31.  
  32. JButton btnNewButton = new JButton("");
  33. Image images = new ImageIcon(this.getClass().getResource("/call.png")).getImage();
  34. btnNewButton.setIcon(new ImageIcon(images));
  35. btnNewButton.setBounds(106, 92, 268, 133);
  36. contentPane.add(btnNewButton);
  37.  
  38.  
  39. JButton button = new JButton("");
  40. button.setBackground(Color.WHITE);
  41. Image images2 = new ImageIcon(this.getClass().getResource("/msg.png")).getImage();
  42. button.setIcon(new ImageIcon(images2));
  43. button.setBounds(106, 241, 268, 125);
  44. contentPane.add(button);
  45.  
  46.  
  47.  
  48. JLabel lblNewLabel_1 = new JLabel("");
  49. Image images1 = new ImageIcon(this.getClass().getResource("/oc.png")).getImage();
  50. lblNewLabel_1.setIcon(new ImageIcon(images1));
  51. lblNewLabel_1.setBounds(38, 16, 435, 60);
  52. contentPane.add(lblNewLabel_1);
  53. }
  54. }
  55.  
  56. <dependency>
  57. <groupId>com.twilio.sdk</groupId>
  58. <artifactId>twilio-java-sdk</artifactId>
  59. <version>3.4.5</version>
  60. </dependency>
  61.  
  62. import java.util.Map;
  63. import java.util.HashMap;
  64.  
  65. import com.twilio.sdk.TwilioRestClient;
  66. import com.twilio.sdk.TwilioRestException;
  67. import com.twilio.sdk.resource.instance.Account;
  68. import com.twilio.sdk.resource.instance.Call;
  69. import com.twilio.sdk.resource.factory.CallFactory;
  70.  
  71. public class MakeCall {
  72.  
  73. public static final String ACCOUNT_SID = "AC123";
  74. public static final String AUTH_TOKEN = "456bef";
  75.  
  76. public static void main(String[] args) throws TwilioRestException {
  77.  
  78. TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
  79. Account mainAccount = client.getAccount();
  80. CallFactory callFactory = mainAccount.getCallFactory();
  81. Map<String, String> callParams = new HashMap<String, String>();
  82. callParams.put("To", "5105551212"); // Replace with your phone number
  83. callParams.put("From", "(510) 555-1212"); // Replace with a Twilio number
  84. callParams.put("Url", "http://demo.twilio.com/welcome/voice/");
  85. // Make the call
  86. Call call = callFactory.create(callParams);
  87. // Print the call SID (a 32 digit hex like CA123..)
  88. System.out.println(call.getSid());
  89. }
  90. }
Add Comment
Please, Sign In to add comment