Results 1 to 12 of 12
Thread: help me for a swing project..
- 01-03-2010, 05:59 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
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
- 01-03-2010, 06:26 PM #2
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
I posted a simple Swing program last year.
The official swing tutorial.
Googling "javax swing tutorial" gave me several other pointers to try.
- 01-03-2010, 07:11 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
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..?
- 01-04-2010, 12:01 AM #4
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
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.
- 01-04-2010, 10:29 AM #5
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
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..?
- 01-04-2010, 10:35 AM #6
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Keep them separate.
See: Doing Swing right - Java insights
for some ideas.
- 01-04-2010, 05:03 PM #7
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
: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... :)
-
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.
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.i would be very helpfull to me if some one guides me to d rite way.. thnks a lot in advance... :)
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!
- 01-05-2010, 03:24 PM #9
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
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.
- 04-04-2010, 07:46 PM #10
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
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?
-
Again, what is "d"? Have you read the posts above?
- 04-04-2010, 09:21 PM #12
Member
- Join Date
- Jan 2010
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
open existing project project ..
By itaipee in forum EclipseReplies: 1Last Post: 12-28-2008, 08:12 PM -
Memory Leak using a Swing Application Project
By iimasd in forum AWT / SwingReplies: 0Last Post: 11-27-2007, 10:20 AM -
AWT or Swing
By bugger in forum AWT / SwingReplies: 4Last Post: 11-22-2007, 09:44 AM -
map javax.swing.text.Element to javax.swing.text.View
By elizabeth in forum New To JavaReplies: 1Last Post: 07-30-2007, 07:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks