Using default table models help!

I have a small program that allows the user to enter two values (a and b) and then the range between these numbers is output in a table. e.g. a=1 and b=5 result would be 1,2,3,4,5. This works fine but when the result is printed the column titles change to A and B is there a way of changing these values. Is there a way of getting the same result without having to use the import? Also can someone explain to me what "import javax.swing.table.DefaultTableModel;" means and what it does.

Thanks

int a = Integer.parseInt(txtRangeFrom.getText());

int b = Integer.parseInt(txtRangeTo.getText());

DefaultTableModel model =new DefaultTableModel(b-a+1, 2);

for(int row = a; row <= b; ++row)

for(int col = 0; col <= 1; ++col)

model.setValueAt(String.valueOf(row), row-a, 0);

tblOut.setModel(model);

[1083 byte] By [T-mosea] at [2007-11-27 1:27:24]
# 1
Not quite sure what you are saying but take a look at TableModel and JTable. Both have constructors that allow you to specify "column titles".
filestreama at 2007-7-12 0:23:43 > top of Java-index,Java Essentials,New To Java...
# 2
The import just clarifies for the compiler which class you are referring to when you say:DefaultTableModel http://java.sun.com/docs/books/tutorial/java/package/usepkgs.html
pthorsona at 2007-7-12 0:23:43 > top of Java-index,Java Essentials,New To Java...