I have data stored in array list object here :
ArrayList<Long> itr= new ArrayList<Long>();
ArrayList<Double> dub = new ArrayList<Double>();
ArrayList<String> str = new ArrayList<String>();
I am able to print sample data with the below program how do I pass all the array list object data here? so that I can get array list data in jtable tabular column. I am only able to fetch individual values. How do I do it with for loop?
class ColoumnHeader extends JFrame
{
public ColoumnHeader()
{
super("Jtable Layout");
setDefaultCloseOperation(EXIT_ON_CLOSE);
String[] ColoumnHeaders={"Integers","RealNumbers","OtherTokens"};
JTable table=new JTable(new Object[][]{{itr.get(1),dub.get(1),str.get(1)}},ColoumnHeaders);
table.setPreferredScrollableViewportSize(new Dimension(500,80));
JScrollPane pane = new JScrollPane(table);
getContentPane().add(pane,BorderLayout.CENTER);
}
}
public class asm
{
public static void main(String[] args)
{
ColoumnHeader c=new ColoumnHeader();
c.setVisible(true);
}
}