Register Form with Swing GUI inJava

Register Form with Swing GUI inJava

Page 1 of 1

4 Replies - 23670 Views - Last Post: 26 May 2010 - 06:29 PM Rate Topic: -----

#1 theary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 26-May 10

Register Form with Swing GUI inJava

Posted 26 May 2010 - 03:18 AM

Dear All,

I am new in Java programming now i want to create registration form connect to mysql database for store information of register people in mysql database.

I really appreciate if anyone can help me about coding and design form in swing GUI.

Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: Register Form with Swing GUI inJava

#2 aniri  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 54
  • View blog
  • Posts: 657
  • Joined: 24-November 09

Re: Register Form with Swing GUI inJava

Posted 26 May 2010 - 03:24 AM

You could check out the java tutorials here on the forum. Look for swing tutorials and jdbc tutorials for connecting to mysql.
Was This Post Helpful? 0
  • +
  • -

#3 m-e-g-a-z  Icon User is offline

  • Winning
  • member icon


Reputation: 496
  • View blog
  • Posts: 1,453
  • Joined: 19-October 09

Re: Register Form with Swing GUI inJava

Posted 26 May 2010 - 04:25 AM

Well, your gonna want to use JTextFields within your program, get the text of them and store them in variables.

For things such as Date, i would have a JComboBox having the dates on there.

Heres a useful url to get you started with the JDBC (MySQL). Using JDBC with MySQL Getting Started.


So lets say you get the name of the JTextField, you assign the value to a String called name.

From there you will have a connection, something looking similar to this below, check out what parameters you will need.

Connection con = DriverManager.getConnection("jdbc:mysql:///test",
        "root", "secret");




Make sure that you have this as within your class.

 Statement stmt; 


You will then invoke a createStatement() method on the con (Connection) object which will create a statement.

 stmt = con.createStatement();


You will then invoke the executeUpdate() method on the Statement object having the query as String as the method takes a single String as its parameters.

Something like this..
stmt.executeUpdate(
                       "INSERT into Register values ('"+name+"'");


Obviously, you are going to insert more data, this is just a simple example :)

This post has been edited by m-e-g-a-z: 26 May 2010 - 04:29 AM

Was This Post Helpful? 1
  • +
  • -

#4 theary  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 26-May 10

Re: Register Form with Swing GUI inJava

Posted 26 May 2010 - 06:22 PM

Thank you for your kindly reply!!!
Was This Post Helpful? 0
  • +
  • -

#5 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8334
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Register Form with Swing GUI inJava

Posted 26 May 2010 - 06:29 PM

asked so many times
I wrote a snippet about it

http://www.dreaminco...snippet4460.htm
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1