Results 1 to 12 of 12
  1. #1
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Post help me for a swing project..

    hi,

    i am new to java & have a basic idea about java swings.

    i want to build a GUI for mysql because swings is something that fascinates me..

    wat is that bothering me is wer to start to build GUI of such kind & what all i need to study for that. offcourse i need swings.. :p

    pls help me.. waiting for replies.. :) :D

  2. #2
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    I posted a simple Swing program last year.

    The official swing tutorial.

    Googling "javax swing tutorial" gave me several other pointers to try.

  3. #3
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default

    yes i do know know d basics of swings..but wat i wanted to know was how to interact wid mysql..

    is it by jdbc..?

  4. #4
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    JDBC is the general mechanism for dealing with data bases from Java.
    So I googled "mysql jdbc driver" and got lots of possibilities.
    One likely looking one is MySQL Connector/J. I have not tried it.

  5. #5
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default

    ya JDBC driver is called connector..

    but wat i wonder is connector is wat i shd use to connect my GUI wid d mysql DBMS..?

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Keep them separate.

    See: Doing Swing right - Java insights

    for some ideas.

  7. #7
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Default

    :confused
    am not getting d rite direction from wer to start d project..

    i would be very helpfull to me if some one guides me to d rite way.. thnks a lot in advance... :)

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by akkis View Post
    :confused
    am not getting d rite direction from wer to start d project..
    One word of unasked for advice: Please avoid unnecessary abbreviations in your posts here. I recommend this for several reasons:

    1) Programming is an exercise in precision. When you communicate here (or anywhere) about programming issues and questions, you want this communication to be as clear as possible to avoid any chance for ambiguity. I'd say at least half the answers here are requests for clarification. Let's avoid that.

    2) For many here, English is not their first (or second or third) language. It's hard enough for them to understand what people are posting here much less if it's couched in obscure and non-standard abbreviations.

    3) Extra letters don't cost anything here, so you might as well use them.

    4) It makes the poster seem a bit immature and thus for some not worthy of help.


    i would be very helpfull to me if some one guides me to d rite way.. thnks a lot in advance... :)
    This may be very difficult at this time, as your question is very general and there is no "one-size fits all" answer here. So to answer in any fashion other than links to the tutorials would take pages and pages of reply. Also, your confusion suggests that you're not understanding the replies yet because you don't have a solid enough foundation in Swing and JDBC enough to move forward. The best solution at this point (and you're not going to like this), is to continue to study the Swing and JDBC tutorials until you understand them both well enough to combine them.

    As noted above, you should strive to keep your Swing code and your database code as separate as possible. The only other tip that has not been mentioned and is worth noting is that you should do all your database interactions off of the main Swing thread, the EDT, otherwise you will freeze your Swing app, and your users will not be very happy with you. To learn more about this, please look at yet another tutorial:
    Lesson: Concurrency in Swing

    Much luck!

  9. #9
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    When I build a user interface, I begin by listing the data values that will be shown.
    Then I define a class of objects that will contain those values.
    And a second class to be a collection of those value objects.
    That second class is the most likely place to put the mysql interface code.

    Suppose I want to display the body mass for a bunch of people.
    The data I need from the database is name, height, and weight.
    So I define the class Dieter to have those values.
    Dieter also has a method to compute the body-mass index.
    And a second class Subjects to be a list of Dieter objects.
    A Subjects object has methods to fetch a set of records from the database,
    creating a Dieter object for each fetched record.
    The GUI operates on a single Subjects object.

  10. #10
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

    Unhappy

    thanks a lot for the reply..

    now i have started with the above said task.

    Since d GUI for mysql requires to interact with database, so am done with almost half of the work.

    But one place i am stuck is i just want take username & password at d time of login. with tat username i want to create a connection object & then pass tat connection object throughout the whole program so tat i dont need to create a connection object everytime i interact with database. but am not able to pass that connection object throughout the program.

    one way i tried doing it is i have declared d connection object as static but even then am facing problem with this.

    can anyone please give me an idea how do this?

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

  12. #12
    akkis is offline Member
    Join Date
    Jan 2010
    Posts
    6
    Rep Power
    0

Similar Threads

  1. open existing project project ..
    By itaipee in forum Eclipse
    Replies: 1
    Last Post: 12-28-2008, 09:12 PM
  2. Memory Leak using a Swing Application Project
    By iimasd in forum AWT / Swing
    Replies: 0
    Last Post: 11-27-2007, 11:20 AM
  3. AWT or Swing
    By bugger in forum AWT / Swing
    Replies: 4
    Last Post: 11-22-2007, 10:44 AM
  4. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •