Click to See Complete Forum and Search --> : Generation Registration number--- very urgent


Anand
February 4th, 1999, 05:25 AM
i have a column in my Jtable in which registration number has to generate automatically.

this registration number should be system date concatenated to the serial number.

for example if am the fisrt candidate my registration number would be 104021999 and if am the second

candidate my regno would be 204021999. how can i accomplish this task????

thanks,

anand

anand
February 4th, 1999, 05:25 AM
i have a column in my Jtable in which registration number has to generate automatically.

this registration number should be system date concatenated to the serial number.

for example if am the fisrt candidate my registration number would be 104021999 and if am the second

candidate my regno would be 204021999. how can i accomplish this task????

thanks,

anand

krisSomu
July 9th, 1999, 07:31 PM
Hi,
You have to define a class that extends AbstractTableModel and you have a method in it setValueAt(i,j). i.e

public Object setValueAt(int i, int j){
return regno;
}

Here regno is the registration number in the format you require. To generate the regno you have to append the serial no.(or you can get the serial no. by adding one to getRowCount() method) to the System date and finally convert the resultant String to Object.

Hope this helps.

-Somu.