开发者

Help with ComboBox In Jsp code

following is the .jsp code to populate combobox:

   <%
  {
  List <String> lststringIncidentIds = new ArrayList <String>();
  lststringIncidentIds.clear();
  String AllIds;
  AllIds = "";

  for (int i =0; i<wp.size();i++)
  {

 AllIds = "";
//1st work product
WorkProduct wpa;
wpa = wp.get(i);

//Metadata of Work Product
PackageMetadataType pms;
pms = wpa.getPackageMetadata();

IdentificationType Elementa;
pms.getPackageMetadataExtensionAbstract().get(0).getValue();

Elementa = (IdentificationType) 
wp.get(i).getPackageMetadata().getPackageMetadataExtensionAbstract().get开发者_JS百科(0).getValue();
AllIds = Elementa.getIdentifier().getValue();
lststringIncidentIds.add(AllIds);
out.println("Incident ID: " + i + " " +AllIds + "<br>"); 

I want to pass AllIds variable to a combobox.


<body>
  <h1>Hello World!</h1>
     <%
       JFrame f;
       JComboBox cmbox;
       JPanel panel;


       //ComboBox b= new ComboBox();
       String course[] = {"BCA","MCA","PPC","CIC"};
       cmbox = new JComboBox(course);
       panel = new JPanel();
       panel.add(cmbox);
       //panel.setSize(400,400);
      //panel.setVisible(true);
       f=new JFrame("My Frame");
       f.add(panel);
       f.setSize(400,300);
       f.setVisible(true);
       %>

     </body>
      the combobox will not appear in the browser as its a swing component but this   

      code will help u understand the difference....try it...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜