I am trying to add value to a I tried How do you populate "data" in the loop for a while? Use a defaultTableModel and use its addRow (Object []] or Adrev (vector) method. By adding lines of data. Set it as your Jettable model, you can get started with API and JTT tutorials. For example, It does this with Jtable , how the values are met from the arrayList Do you do this
object [] [] [] [] [] [] data] and populate it inside a loop, but it does not work , How do you fix this?
string [] column = {"field string", "field double", "field double"}; Object [] [] data; Iterator & LT; Node & gt; Itr = arrayList.iterator (); While (IRHAS-Next ()) {node AL = it Nxt (); Double A = L. Gateval (); Data [i] [1] = el.getstring (); Data [i] [2] = a; Data [i] [3] = one * 4; I ++; } Jeffre Frame = New Geoffram ("title"); JTable tablE = new JTable (data, column); Zpean panel = new zpn (); Panel.add (table); Frame.add (panel); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Frame.setSize (500, 500); Frame.setVisible (true);
ArrayList arrayList = new ArrayList (); String [] column = {"field string", "field double", "field double"}; DefaultTel Model Model = New DefaultTel Model (Column, 0); For (object items: straightlist) {object [] line = new object [3]; // ... fill the row with information from the item model. AddRow (line); } JTable table = new JTable (model);
for the loop, but
while the loop will be the same.
Comments
Post a Comment