i started a project at school but not sure of what am doing
am designing a shop records system, that takes item name and price from the shop attendant
and when enter is hit this 2 data goes into the database.
the project also include, a calculation of balance button. with few menu and menu items
apparently, i have developed the interface but finding it difficult to come out with the event handlers
PLEAS HELP ME
2 Replies - 527 Views - Last Post: 09 January 2013 - 09:18 AM
#1
How use Event handler to collect data from a jframe into the datab
Posted 09 January 2013 - 07:23 AM
Replies To: How use Event handler to collect data from a jframe into the datab
#2
Re: How use Event handler to collect data from a jframe into the datab
Posted 09 January 2013 - 07:55 AM
When you have the button object, you need to attach a listener to it and then create a method that will be executed when button is pressed.
e.g.
e.g.
JButton button = new JButton("Add to database"); button.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent event){ //add the things to the database in here } });
#3
Re: How use Event handler to collect data from a jframe into the datab
Posted 09 January 2013 - 09:18 AM
You need to start from the beginning. Practice your Swing!
Page 1 of 1