Re: action listeners on java
Show the JTextField's actionPerformed() method.
Re: action listeners on java
Can you make a Short, Self Contained, Correct Example that shows the problem?
Re: action listeners on java
Quote:
Originally Posted by
Norm
Code :
private void Customers_TableMouseClicked(java.awt.event.MouseEvent evt) {
carsModelcmb.setSelectedIndex(0); //set selected index to 0(set to select) in the cars model combobox
custDetailsList.setListData(new String[]{"Select"}); //set text to select in JList
txtsearch.setText(null); //empty the search textfield
on the execution of the line "carsModelcmb.setSelectedIndex(0)" then trigger the combo box action performed method which executes other code.
Code :
private void carsModelcmbActionPerformed(java.awt.event.ActionEvent evt) {
if(carsModelcmb.getSelectedIndex()>0){ //solved with the current line of code
code .....
Any opinions are welcome. :cool:
--- Update ---
I have managed to develop an application in java for a hotel and the owner told me that he wants to do the following tasks: add guess or company profile, invoice, rooms availability, etc.Can you help me to find the right book to do the analysis and design of the particular system in order to create a good normalization and correct relation with the tables in order to build correctly the database tables.I hope you understand me. :D
Re: action listeners on java
If the combo box action is doing something that isn't desired when the state of the combo box is modified, then change the code that is doing the thing you don't want.
Remember, as the programmer you're in charge, it's your program, and you can make it do exactly as you wish. Don't let the code be in charge of you.
As for helping you learn how to interface with a database, start searching the web. All of the info you need is there.