[英]Don't get to view in the Design View - NetBeans
我聲明兩個數組並將它們初始化為字段聲明:下面是示例:
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)}
};
然后將jTable拖放到Frame中。 然后轉到表Property> model> Custom Code,然后在其中編寫以下代碼:
new DefaultTableModel(data, columnNames)
當我運行該應用程序時,可以正常工作。但是通過這種方式,我無法在Netbeans的設計視圖中對其進行查看。
告訴我! 為什么即使我在屬性中使用以下代碼訪問數組,Design視圖也無法查看它
new DefaultTableModel(data, columnNames)
當前不支持此功能的Netbeans可能在更高版本上可用。 它不僅沒有在設計視圖上顯示視圖,而且還可以正常工作。 因此,我認為沒有設計視圖,您就可以繼續工作,而不是問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.