Guest User

Untitled

a guest
Jun 28th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. Error: A JNI error has occurred, please check your installation and try again
  2. Exception in thread "main" java.lang.NoClassDefFoundError: com/toedter/calendar/
  3. JDateChooser
  4. at java.lang.Class.getDeclaredMethods0(Native Method)
  5. at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  6. at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
  7. at java.lang.Class.getMethod0(Class.java:3018)
  8. at java.lang.Class.getMethod(Class.java:1784)
  9. at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544
  10. )
  11. at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  12.  
  13. Caused by: java.lang.ClassNotFoundException: com.toedter.calendar.JDateChooser
  14. at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  15. at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  16. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
  17. at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  18. ... 7 more
  19.  
  20. import com.toedter.calendar.JDateChooser;
  21. public class Login implements ActionListener {
  22. private JFrame ourFrame = new JFrame("Login");
  23.  
  24. JTextField user_text = new JTextField();
  25. JPasswordField pass_text = new JPasswordField();
  26. static JDateChooser calendario = new JDateChooser();
  27.  
  28. JButton yesButton = new JButton("Confirmar");
  29. JButton noButton = new JButton("Cancelar");
  30.  
  31. public Login() {
  32. ourFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  33. ourFrame.setBounds(600, 300, 400, 250);
  34.  
  35. Container container = ourFrame.getContentPane();
  36. container.setLayout(null);
  37.  
  38. JLabel logo1 = new JLabel("LOGIN CLEARQUEST");
  39. logo1.setBounds(130, 10, 250, 20);
  40.  
  41. JLabel user_label = new JLabel("Usuário:");
  42. user_label.setBounds(20, 35, 250, 30);
  43.  
  44. JLabel pass_label = new JLabel("Senha:");
  45. pass_label.setBounds(20, 70, 250, 30);
  46.  
  47. user_text.setBounds(70, 40, 250, 20);
  48. pass_text.setBounds(70, 75, 250, 20);
  49.  
  50. JLabel logo2 = new JLabel("INSIRA A DATA DO ÚLTIMO RELATÓRIO");
  51. logo2.setBounds(83, 100, 250, 30);
  52. calendario.setBounds(83, 130, 210, 25);
  53.  
  54. yesButton.setBounds(70, 170, 100, 30);
  55. yesButton.addActionListener(this);
  56.  
  57. noButton.setBounds(210, 170, 100, 30);
  58. noButton.addActionListener(this);
  59.  
  60. container.add(logo1);
  61. container.add(user_label);
  62. container.add(pass_label);
  63. container.add(user_text);
  64. container.add(pass_text);
  65. container.add(logo2);
  66. container.add(calendario);
  67. container.add(yesButton);
  68. container.add(noButton);
  69. ourFrame.setVisible(true);
  70. }
  71.  
  72. @SuppressWarnings("deprecation")
  73. public void actionPerformed(ActionEvent aE) {
  74. if (aE.getSource() == yesButton) {
  75. String user = user_text.getText();
  76. String pass = pass_text.getText();
  77.  
  78. RESTInvoker rest = new RESTInvoker(user, pass);
  79. String json = rest.getDataFromServer();
  80.  
  81. try {
  82. // TODO pega os dados do json (arquivo txt retirado do clearquest) e joga em um Array de testes
  83. Teste[] teste = null;
  84. teste = Json.criarJson(teste, json);
  85.  
  86. DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
  87. Date date = new Date();
  88.  
  89. String caminhoTemplate = Variaveis.getCaminhoTemplate();
  90. String caminhoDestino = Variaveis.getCaminhoExcel() + dateFormat.format(date) + ".xls";
  91.  
  92. // verificar o caminho
  93. CriacaoExcel.criandoArquivo(caminhoTemplate, caminhoDestino, teste);
  94.  
  95. }
  96.  
  97. catch (InvalidFormatException e) {
  98. CaixaDialogo.exibirErro(e.getMessage());
  99. }
  100.  
  101. catch (ParseException e) {
  102. CaixaDialogo.exibirErro(e.getMessage());
  103. }
  104.  
  105. } else if (aE.getSource() == noButton) {
  106. System.exit(0);
  107. }
  108.  
  109. }
  110.  
  111. // envia a data, do relaatório antigo, escolhida pelo usuario
  112. public static Date enviaData() {
  113. return calendario.getDate();
  114. }
  115.  
  116. public static void main(String[] args) {
  117. // para setar o foco nos botões
  118. EventQueue.invokeLater(new Runnable() {
  119. @Override
  120. public void run() {
  121. UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
  122. new Login();
  123. }
  124. });
  125. }
  126. }
Add Comment
Please, Sign In to add comment