Seriously, just go and create your own table model:

http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/table/AbstractTableModel.html

It's rare to see anyone use a default model beyond the first 15 mins of
prototyping...



On 1 July 2010 09:15, Wildam Martin <[email protected]> wrote:

> On Thu, Jul 1, 2010 at 09:28, Bayan <[email protected]> wrote:
> >> The easiest way is to right-click on a newly created JTable in the
> >> Matisse (=Netbeans Swing GUI editor) -> "Table contents..." -> Columns
> >> -> <add and remove columns as you like> and then switch to code view
> >> and expand the folded generated code.
> > Thanks for help, but i want add and remove rows, i use Vector of
> > Element but i don't know how i insert it to Table
>
> I start getting into doubt if I got it right, what you are trying to
> achieve.
>
> Adding a row to a table with default table model is quite simple -
> just to give an example:
>
>    public static void addTableRow(DefaultTableModel model, String...
> columns)
>    {
>        model.addRow(columns);
>    }
>
> Not sure why you are using the Vector.
>
> For setting a particular value by giving it's row and column use
> model.setValueAt.
> Just an important thing (if you don't already know): Don't mix up row
> index in table with row and column index in model - it is not the same
> for both if the table gets sorted or columns get moved.
> --
> Martin Wildam
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
>


-- 
Kevin Wright

mail/google talk: [email protected]
wave: [email protected]
skype: kev.lee.wright
twitter: @thecoda

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to