import javax.swing.*;
import java.awt.*;
import java.awt.event.*;public class companel extends JFrame
{

Choice type;
JPanel pan=new JPanel();
int i=0,j=0;
Button submit;

public companel()
{
getContentPane().setLayout(null);
getContentPane().add(pan);
pan.setBounds(10,10,300,300);
pan.setLayout(null);
while(i<4)
{
type=new Choice();
pan.add(type);
type.setBounds(i*80+40,20,80,25);
type.add(i+"");
type.add("选项一");
type.add("选项二");
type.add("选项三");
type.add("选项四");

submit=new Button("确定");
pan.add(submit);
submit.setBounds(100,150,60,25);
submit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
WindowSubmit();
}});
i++;
}

setSize(400,400);
setTitle("循环窗体");
show();
}

private void WindowSubmit()
{
j=0;
while(j<4)
{
Component component=pan.getComponentAt(j*80+40,20);
String com=component.toString();
JOptionPane.showMessageDialog(null,com,"",JOptionPane.INFORMATION_MESSAGE);
j++;
}
}


public static void main(String args[])
{
new companel();
}
}现在的输出结果是java.awt.Choice(choice0,40,20,80*21,current=0)我想只得到current的结果
就是获得选择的具体选项请教应该怎么做?