Hy...My name in Alin , and I'm new using Java language/code . I'm trying make a little / simple JAva desktop aplication . Sometthing like phone book , but very very simple .
I using Neatbeans 6.8 and mysql-essential-5.1 .I maked interface of that project using Java swing , I intalled swl server , I created the project and the table for database ( I need just 1 table ).
Now I want make action for my buttons ( bur realy I faild - I spoke with people who make all project only for code ; they can't hep me)
I need sugestions how to make that events please ( on net I don't recived this things , only how make this on code)
I am beginers and that beggin is very dificult for me...I hope that u cand help me to finish that little project ; It is important for me for stimulation .
Thanks for help ... Have a nice day:
This is the " look " of my project :

Re: Bind Button -code ; database - code 80 80

Have you written any code or, you used exclusively the gui builder for that?

You should learn how to code those events. How to add action listeners to your buttons. You need to read some tutorials and try to make that gui on your own.
Just declare those components and add them to your main JFrame.
Classes you will need:
javax.swing.JText (for text fields)
javax.swing.JLabel (for labels)
javax.swing.JButton (for buttons)

Check the API for their methods and constructors.

And if you are a beginner then this project way too much for you. You will one main JFrame with buttons like a menu where you need to select if you want to add a new contact or view the existing ones. Those would be independent classes/JFrames. Once one of those buttons is clicked you need to call its class by creating a new instance of that JFrame and display it.

Assuming you have classes for adding and viewing that extend JFrame: JView.java, JAdd.java.
Then depending on the button clicked:

JView view = new JView(); // JView extends JFrame
view.setVisible(true); // method inherited from JFrame
Re: Bind Button -code ; database - code 80 80

Hy I used only the gui builder for that interface. It was persons how take me exact the same advice ( read about " action listener " ).
When I maked Cisco courses we used something like that ( in that course we maked the interface and in next course I had a problem and I didn't finish the course ).
Oky ,in thi situation I will take a tutorial and I will tr make this project.
A little more question please... : do you know any good tutorial about that thing?
I'll use google to find something good but I don't know , when you help mme , you give me a lot of good stimulation.
Thanks very much for your help ...

Re: Bind Button -code ; database - code 80 80

You can try the sun's tutorials.
Personally I had a beginner's book about java that had a chapter on how to make gui and how clicking buttons work

Re: Bind Button -code ; database - code 80 80

Now I'm starting read this : http://download.oracle.com/javase/tutorial/uiswing/index.html
I hope that this link be useful...Thanks very much for your help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.