Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extract data from a form  RSS feed

 
visu Nekk
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,

I am a novice to swings.i have created a form which comprises of textboxes,lists,combobox.When i cllick on the submit button,i should be able to store the data in a database.Could u please guide me.
Thanx in advance.
 
todd runstein
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a web page or a Swing app?

If it's a swing app, your submit button needs to include a action listener:

JButton button = new JButton("submit");
button.addActionListener(new ActionListener(){
public void actionPerformed(){
doSubmit();
}
});
-- Not checked for errors, use at your own risk --


Then, you need to add the doSubmit method - this will simply read each component you're interested in (textfields and such) and send the information to a database (probably using JDBC).

I hope this gets you started. If you need more help, try posting the code that causing you trouble.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And by the way, it's called "Swing", not "swings". Note the name of the forum, for example.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!