1
A
回答
3
要測試JComboxBox
引用是否爲null
,可以使用==
運算符將其與null
進行比較。要測試組合框是否包含任何項目,可以使用實例方法getItemCount
,該方法返回它包含的項目數。
JComboxBox box = ...
boolean boxIsNull = (box == null); // answers the title of the question
boolean boxHasItems = (box.getItemCount() > 0);
+0
感謝一羣朋友。 – Rabin 2010-11-14 09:25:15
相關問題
- 1. 的Java:檢查null
- 2. Java string null檢查!= null或!str.equals(null)?
- 3. Java中的對象null-ness檢查
- 4. JAVA - 從結果集中檢查NULL值
- 5. 在GLSL NULL檢查
- 6. Java/Scala項目:檢查null與匹配
- 7. Java「this」null檢查計劃任務
- 8. Null值檢查
- 9. NSData null檢查
- 10. 檢查處理程序!= null與檢查事件!= null在C#
- 11. 檢查空,== NULL VS = NULL
- 12. 在Java(Android) - > crash中檢查null和「emptyness」 - >崩潰
- 13. 如何在java中檢查字符串null?
- 14. 檢查CGRect null在getter
- 15. 如何在javaScript函數中檢查null?
- 16. 如何檢查null是否在流中?
- 17. 爲什麼在Array.prototype.forEach()中檢查null?
- 18. 如何在C++中檢查null類
- 19. NULL在LINQ表達式中檢查SQL
- 20. AngularJS - 在ng-repeat中檢查null項
- 21. c - 在二維數組中檢查null
- 22. 在VBA中使用NULL檢查長度
- 23. 在lambda表達式中檢查null - linq
- 24. 在C++中強制NULL檢查
- 25. 在omdnapi中檢查null響應
- 26. 在C#中檢查NULL LINQ表達式
- 27. C#IQueryable在OrderBy中檢查null ckeck
- 28. 在LINQ中集成NULL檢查
- 29. 在android中檢查null字符串
- 30. LINQ不檢查null
什麼是綁定JComboBox? – aioobe 2010-11-14 07:22:07
這是一個錯字。我只是指普通的JComboBox。 – Rabin 2010-11-14 09:05:01