hello guys, i have created a jform which contains these field;
ComboBox_decCode(description code)
ComboBox_itemCode(item code)
combo_Area(Branch_Area)
ComboBox_dept(Branch_Code)
txt_sn(Serial Number)

i want to generate a serial key based on these information in my database.

Description         Description_Code       
---------------      ---------------- 
Lands & Building          LB(001) 


 Branch_Area           Branch_Code 
------------          ------------- 
Labone                     LB(001)

now the idea is when i select all the data for each combox on my jform it should automatically generate a serial key in the txt_sn.

i want to generate my serial number based on a default "FC"+/ +Branch_Code+/+Description_Code
example is FC/LB/100/LB/001 so the FC constant
Any directions or help will be appreciated THANK YOU

how to go about getting it to display after those fields have been selected
am new still new at java so much help will be appreciated

Each of those Swing components has a get... method to get the current value/selection, so all you need to do is to get all those values, cast them to String if necessary (some methods may just return an Object) and concatenate them all together like in your first post (3rd line up from bottom).

ok so with this sample code how do i connect it with my database information above.

public class Serial {
    private String Description_Code ;
    private int Branch_Code ;
   Final private string FC;

    public void display(){
        System.out.printf("Employee %s, ID:%d earn %.2f per month", getDescription_Code(),getBranch_Code();
    }

    public void setDescription_Code( String Description_Code ){
        this.name = Description_Code;
    }

    public void setBranch_Code( int Branch_Code ){
        this.ID = Branch_Code;
    }



    public String getDescription_Code (){
        return this.Description_Code ;
    }

    public String getBranch_Code(){
        return this.Branch_Code;
    }
}

i would appreciate the help please cos am really new at this

This article has been dead for over six months. Start a new discussion instead.