Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. package us.thetaco.teamspeak;
  2.  
  3. import java.awt.*;
  4. import javax.swing.*;
  5. import java.io.BufferedReader;
  6. import java.io.IOException;
  7. import java.io.InputStreamReader;
  8. import java.io.PrintWriter;
  9. import java.text.DateFormat;
  10. import java.text.SimpleDateFormat;
  11. import java.util.Calendar;
  12.  
  13.  
  14. public class TeamSpeak {
  15.  
  16. private static void createWindow() {
  17. JFrame frame = new JFrame("Application Tool");
  18. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  19.  
  20. JLabel textLabel = new JLabel("I'm a label in the window", SwingConstants.CENTER);
  21. textLabel.setPreferredSize(new Dimension(300, 100));
  22. frame.getContentPane().add(textLabel, BorderLayout.CENTER);
  23.  
  24. frame.setLocationRelativeTo(null);
  25. frame.pack();
  26. frame.setVisible(true);
  27. }
  28.  
  29. static final int daysToAdd = 14;
  30.  
  31. public static void main(String[] args) {
  32.  
  33. BufferedReader br = null;
  34.  
  35. try {
  36.  
  37. br = new BufferedReader(new InputStreamReader(System.in));
  38.  
  39. // promts the users
  40. System.out.print("Name of Applicant: ");
  41.  
  42. // use MEANINGFUL names to store data
  43. String name;
  44.  
  45. // wait for user input and store it in this variable
  46. name = br.readLine();
  47.  
  48. System.out.print("Unique Teamspeak ID: ");
  49.  
  50. String ID;
  51.  
  52. ID = br.readLine();
  53.  
  54. System.out.print("Application Link: ");
  55.  
  56. String app;
  57.  
  58. app = br.readLine();
  59.  
  60. // get the current date
  61. Calendar cal = Calendar.getInstance();
  62.  
  63. cal.add(Calendar.DAY_OF_MONTH, daysToAdd);
  64.  
  65. DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
  66.  
  67. // the the formattedDate variable to print out the modified date
  68. String formattedDate = dateFormat.format(cal.getTime());
  69.  
  70. createwindow();
  71.  
  72. // print out the finalized data to the user
  73. PrintWriter writer = new PrintWriter("apptool.txt", "UTF-8");
  74. writer.println("--------------------------------------");
  75. writer.println("");
  76. writer.println("Welcome " + name + ", your application has been Approved.");
  77. writer.println("");
  78. writer.println("Please Download Teamspeak3 and connect to our server at (2445584.ts3.multiplaygameservers.com) and join the application channel so we can get you set up.");
  79. writer.println("");
  80. writer.println("We look forward to hearing from you!");
  81. writer.println("");
  82. writer.println("--------------------------------------");
  83. writer.println("");
  84. writer.println("Hello, " + name);
  85. writer.println("");
  86. writer.println("Due to you being under the age of 18, your application has been Declined.");
  87. writer.println("");
  88. writer.println("Sorry for the inconvenience.");
  89. writer.println("");
  90. writer.println("--------------------------------------");
  91. writer.println("");
  92. writer.println("Hey, " + name + ". Your trial starts today and ends on " + formattedDate + ".");
  93. writer.println("");
  94. writer.println("--------------------------------------");
  95. writer.println("");
  96. writer.println("Hello, " + name);
  97. writer.println("");
  98. writer.println("Due to you not having a functioning microphone your application has been Declined. Once you aqquire a working microphone comment back to this thread.");
  99. writer.println("");
  100. writer.println("We look forward to hearing from you!");
  101. writer.println("");
  102. writer.println("--------------------------------------");
  103. writer.println("");
  104. writer.println("Please vote for our newest trialist, " + name + ".");
  105. writer.println("");
  106. writer.println("If you didn't enjoy talking/playing with the person vote -1 and state your opinion as to why you are voting -1. If you enjoyed playing with the trailist, please vote +1");
  107. writer.println("You can only vote once but you are allowed to change your vote by editing your post.");
  108. writer.println("");
  109. writer.println("Please encourage other members to vote on TEDS. This ensures accurate results. This is not a thread for discussion of other's opinions. Do not share or discuss any information within this TED. Please remember that valid feedback does not include feedback on the skill of the player.");
  110. writer.println("");
  111. writer.println("Teamspeak ID: " + ID);
  112. writer.println("");
  113. writer.println("Link to application: " + app);
  114. writer.println("");
  115. writer.println("--------------------------------------");
  116. writer.close();
  117.  
  118. } catch (IOException e) {
  119.  
  120. System.out.println("Couldn't link to the input stream.. It's time for you to buy a new computer\n");
  121.  
  122. }
  123.  
  124. }
  125.  
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement