fork download
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. /**
  7.  *
  8.  * @author Administrator
  9.  */
  10. import java.sql.*;
  11.  
  12. public class NewJFrame extends javax.swing.JFrame {
  13. Connection conn=null;
  14. /**
  15.   * Creates new form NewJFrame
  16.   */
  17. public NewJFrame() {
  18. initComponents();
  19. }
  20.  
  21. /**
  22.   * This method is called from within the constructor to initialize the form.
  23.   * WARNING: Do NOT modify this code. The content of this method is always
  24.   * regenerated by the Form Editor.
  25.   */
  26. @SuppressWarnings("unchecked")
  27. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  28. private void initComponents() {
  29.  
  30. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  31. addWindowListener(new java.awt.event.WindowAdapter() {
  32. public void windowOpened(java.awt.event.WindowEvent evt) {
  33. formWindowOpened(evt);
  34. }
  35. });
  36.  
  37. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  38. getContentPane().setLayout(layout);
  39. layout.setHorizontalGroup(
  40. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  41. .addGap(0, 567, Short.MAX_VALUE)
  42. );
  43. layout.setVerticalGroup(
  44. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  45. .addGap(0, 512, Short.MAX_VALUE)
  46. );
  47.  
  48. pack();
  49. }// </editor-fold>
  50.  
  51. private void formWindowOpened(java.awt.event.WindowEvent evt) {
  52. // TODO add your handling code here:
  53. conn =Connect.ConnectionDB();
  54. }
  55.  
  56. /**
  57.   * @param args the command line arguments
  58.   */
  59. public static void main(String args[]) {
  60. /* Set the Nimbus look and feel */
  61. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  62. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  63.   * For details see http://d...content-available-to-author-only...e.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  64.   */
  65. try {
  66. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  67. if ("Nimbus".equals(info.getName())) {
  68. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  69. break;
  70. }
  71. }
  72. } catch (ClassNotFoundException ex) {
  73. java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  74. } catch (InstantiationException ex) {
  75. java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  76. } catch (IllegalAccessException ex) {
  77. java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  78. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  79. java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  80. }
  81. //</editor-fold>
  82.  
  83. /* Create and display the form */
  84. java.awt.EventQueue.invokeLater(new Runnable() {
  85. public void run() {
  86. new NewJFrame().setVisible(true);
  87. }
  88. });
  89. }
  90. // Variables declaration - do not modify
  91. // End of variables declaration
  92. }
  93.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: class NewJFrame is public, should be declared in a file named NewJFrame.java
public class NewJFrame extends javax.swing.JFrame {
       ^
Main.java:53: error: cannot find symbol
        conn =Connect.ConnectionDB();
              ^
  symbol:   variable Connect
  location: class NewJFrame
2 errors
stdout
Standard output is empty