joey phillip

Ranch Hand
+ Follow
since Jan 22, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by joey phillip

I have two JComboBoxes (origin,destination) and JMenus for search and book. I created Accelerator for search and book.
This works fine when i select origin, destination airport and then press ctrl+S(search). But when i type destination airport (instead of selecting from JCombobox) and press ctrl+S , it doesn't invoke the search action.

Can some one explain me what is wrong with my code.
Thanks
joey
To stop the remote server i am giving ctrl+C . I didn't implement anything for stopping the server.
any suggessions?
- joey

I am trying to use command pattern to seperate application logic from gui. I have implemented seperate classes for booking and search as explained in http://www.javaworld.com/javaworld/javatips/jw-javatip68.html.

my actionPerformed event looks like this.

public void actionPerformed(ActionEvent e) {
SearchCommand search=new SearchCommand(Dataclient d,String searchCriteria,MyTableModel model);
search.performSearch();
}
I am passing MyTableModel also because to update the JTable after every search. Is there a way to avoid passing MyTableModel and make the the SearchCommand Class independent? How do guys handle this situation
-joey

}
Hi Matt,
Yes. I am storing DataInfo objects in Vector. after every search the Vector will be updated with new data and will be populated in JTable.
Thanks
joey
Hi paul,

Can it be a Vector inside the MyTableModel class ?
read http://www.javaranch.com/ubb/Forum25/HTML/000552.html

Are you storing all db records in the hastable or only the
records which matches searchcriteria?

Thanks
joey
Hi Matt !
Thanks for your response

I am talking about DataInfo's recordNumber field(Unique key).

How do you get recorNumber for lock() and unlock()?
joey
[This message has been edited by joey phillip (edited March 27, 2001).]
I have implemented MytableModel class like this
public class MyTableModel extends AbstractTableModel
{
Vector data = new Vector();
public MyTableModel(String [] header) { ....}
public int getColumnCount(){...}
public Object getValueAt(int row, int col) {
DataInfo dinfo=(DataInfo) data.elementAt(row);
return dinfo.getValues()[col].trim();
}
public void setData(Vector v) {
this.data=v;
}
}
Is it Ok if i use DataInfo inside MyTableModel or it supposed to be more generic.
-joey

How to get the recordNumber when the users selects specfic row in JTable?
I am trying to implement the book method in client side and in my AbstractTableModel class i am using Object [][].
joey
Skip,
Did you use any design patterns for your gui part? Is it going to reduce marks, if i don't use any design pattern and implement all the code inside the actionPerformed method.

Thanks
joey
Congratulations Skip !
joey
" your user interface should be designed with the expectation of future functionality enhancements, and it should establish a control scheme that will support this with minimal disruption to the user when this occurs"
- I have implemented a Single FBNClient class and all my GUI related code is in this class.
- Do i need to follow any specific design pattern. Is there any examples, links for these design patterns.

joey
I will really appreciate if some one can explain how to implement db lock (-1 param in lock).
joey
Do we need to provide lock/unlock in booking method in local mode also?
joey
paul/Dilip,
I modified with String(byte[] bytes, int offset, int length) in readRecord method and it works fine.
But I don't know which method and how to use for getBytes method in write record method.
If anyone help me i will really appreciate.
joey
PS whe i try to change with byte[] getBytes() then strange boxes appear in GUI combo box.