简体   繁体   English

不要在设计视图中查看-NetBeans

[英]Don't get to view in the Design View - NetBeans

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. 然后将jTable拖放到Frame中。 then go to the table Property>model>Custom Code, and there I write the following code: 然后转到表Property> model> Custom 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. 当我运行该应用程序时,可以正常工作。但是通过这种方式,我无法在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 为什么即使我在属性中使用以下代码访问数组,Design视图也无法查看它

    new DefaultTableModel(data, columnNames)

Currently Netbeans not supporting this feature may be on later version it is available. 当前不支持此功能的Netbeans可能在更高版本上可用。 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. 因此,我认为没有设计视图,您就可以继续工作,而不是问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM