Jump to content
Sign in to follow this  
Dt9Malmeida

preciso de ajuda para ligar a uma base de dados em mysql, nao sei como fazer :s

Recommended Posts

Dt9Malmeida
/*
* FormularioLogin.java
*
* Created on 3/Mai/2011, 16:35:46
*/

package agendatelefonica;
import javax.swing.*;
import java.sql.*;
import java.awt.*;
import java.awt.event.*;
/**
*
* @author Davide Almeida
*/

public class FormularioLogin extends javax.swing.JFrame {

    /** Creates new form FormularioLogin */
    public FormularioLogin() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jTextFieldUtilizador = new javax.swing.JTextField();
        jLabelUtilizador = new javax.swing.JLabel();
        jLabelPalavraChave = new javax.swing.JLabel();
        jButtonEntrar = new javax.swing.JButton();
        jPasswordField = new javax.swing.JPasswordField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Agenda Telefonica");
        setName(""); // NOI18N

        jLabelUtilizador.setText("Utilizador");

        jLabelPalavraChave.setText("Palavra-Chave");

        jButtonEntrar.setText("ENTRAR");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButtonEntrar)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelUtilizador, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelPalavraChave, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPasswordField)
                            .addComponent(jTextFieldUtilizador, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldUtilizador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelUtilizador))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPasswordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonEntrar))
                    .addComponent(jLabelPalavraChave))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabelUtilizador.getAccessibleContext().setAccessibleName("jLabelUtilizador");
        jLabelPalavraChave.getAccessibleContext().setAccessibleName("jLabelPalavraChave");
        jButtonEntrar.getAccessibleContext().setAccessibleName("jButtonEntrar");

        getAccessibleContext().setAccessibleName("FormularioLogin");

        pack();
    }// </editor-fold>                        

    /**
    * @param args the command line arguments
    */


    // Variables declaration - do not modify                     
    private javax.swing.JButton jButtonEntrar;
    private javax.swing.JLabel jLabelPalavraChave;
    private javax.swing.JLabel jLabelUtilizador;
    private javax.swing.JPasswordField jPasswordField;
    private javax.swing.JTextField jTextFieldUtilizador;
    // End of variables declaration                   



}

Share this post


Link to post
Share on other sites
Knitter

Existe uma dúvida nesse longo conjunto de caracteres?

Posso perceber que tenhas dificuldades mas seria bom mais informação sobre onde exactamente estão as referidas dificuldades.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.