java - ScrollBar in combobox showing last entry javax.swings.JScrollbar[,0,0] -


package interstateexpress;  import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.sql.*; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.statement; import java.text.dateformat; import java.text.simpledateformat; import javax.swing.imageicon; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.joptionpane; import javax.swing.jtextfield; import java.util.date; import javax.swing.jcombobox; import javax.swing.jscrollbar; import javax.swing.jscrollpane;  public class driverprofile implements actionlistener {      private jframe f;     private jlabel lb_name,lb_email,lb_address,lb_hourlyrate,lb_startdate,lb_homeph,lb_cellph,lb_image;     private jtextfield tx_name,tx_email,tx_address,tx_hourlyrate,tx_startdate,tx_homeph,tx_cellph,tx_image;     private jbutton bt_go,bt_date;     private jcombobox cb;     private jscrollbar pane;     string a[]={"1","2","3","4","5","6","7","8","9","10","11","12","13"};      public driverprofile()     {         f=new jframe();         lb_name=new jlabel("name");         lb_email=new jlabel("e-mail");         lb_address=new jlabel("address");         lb_hourlyrate=new jlabel("hourly rate");         lb_startdate=new jlabel("starting date");         lb_homeph=new jlabel("home phone");         lb_cellph=new jlabel("cell phone");         lb_image=new jlabel("image location");         tx_name=new jtextfield();         tx_email=new jtextfield();         tx_address=new jtextfield();         tx_hourlyrate=new jtextfield();         tx_startdate=new jtextfield();         tx_homeph=new jtextfield();         tx_cellph=new jtextfield();         tx_image=new jtextfield();         bt_go=new jbutton("submit");         cb=new jcombobox(a);         pane = new jscrollbar();         cb.additem(pane);         bt_go.addactionlistener(this);     }     public void launch()     {         f.setlayout(null);         f.setsize(400,600);         f.add(lb_name);         f.add(lb_email);         f.add(lb_address);         f.add(lb_hourlyrate);         f.add(lb_startdate);         f.add(lb_homeph);         f.add(lb_cellph);         f.add(lb_image);         f.add(tx_name);         f.add(tx_email);         f.add(tx_address);         f.add(tx_hourlyrate);         f.add(tx_startdate);         f.add(tx_homeph);         f.add(tx_cellph);         f.add(tx_image);         f.add(bt_go);         f.add(cb);         lb_name.setbounds(20,80,60,20);         tx_name.setbounds(120,80,180,25);         lb_email.setbounds(20,120,60,20);         tx_email.setbounds(120,120,180,25);         lb_address.setbounds(20,160,60,20);         tx_address.setbounds(120,160,180,25);         lb_hourlyrate.setbounds(20,200,80,20);         tx_hourlyrate.setbounds(120,200,50,25);         lb_startdate.setbounds(20,240,80,20);         cb.setbounds(120,240,180,25);         lb_homeph.setbounds(20,280,80,20);         tx_homeph.setbounds(120,280,90,25);         lb_cellph.setbounds(20,320,80,20);         tx_cellph.setbounds(120,320,90,25);         lb_image.setbounds(20,360,90,20);         tx_image.setbounds(120,360,180,25);         bt_go.setbounds(250,400,80,30);         f.setvisible(true);         f.setdefaultcloseoperation(jframe.exit_on_close);     }   } 

last entry of combobox javax.swings.jscrollbar[,0,0]!!!!!! how can remove it? have't add in array list shown above.....plz me remove that. made conbobox start date , entry 1,2,3,4,5,6,7,8,9,10,11,12,13 these trail don't worry that.

i suggest problem

pane = new jscrollbar(); cb.additem(pane); 

you adding jscrollbar combo box item list...


Comments