Question

I Declare two arrays and initialized them into the field declarations: the following is the example:

final String[] columnNames = {"First Name","Last Name","Sport","# of Years","Vegetarian"};
final Object[][] data = {
    {"Mary", "Campione","Snowboarding", new Integer(5), new Boolean(false)},
    {"Alison", "Huml","Rowing", new Integer(3), new Boolean(true)},
    {"Kathy", "Walrath","Knitting", new Integer(2), new Boolean(false)},
    {"Sharon", "Zakhour","Speed reading", new Integer(20), new Boolean(true)},
    {"Philip", "Milne","Pool", new Integer(10), new Boolean(false)}
};

and then drag and drop jTable in Frame. then go to the table Property>model>Custom Code, and there I write the following code:

    new DefaultTableModel(data, columnNames)

When I run the application, working fine.But in this way, I don't get to view it in the Design View of Netbeans.

Update me! why Design view don't get to view it even I use the following code in the property to access the array

    new DefaultTableModel(data, columnNames)
Was it helpful?

Solution

Currently Netbeans not supporting this feature may be on later version it is available. It is only not showing view on design view but working fine. So, I think without design view you can continue your working, not problem at all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top