根據面向對象的原則,我們可以定義任何命名空間中的類作爲private或protected但是當我創建一個類爲private或protected我得到以下編譯錯誤: Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal namespace t
我有一個用戶控制類BaseUserControl和DerivedUserControl類,它是從BaseUserControl派生的。在重建解決方案之後,兩者都在Visual Studio Designer中正確顯示。 在BaseUserControl我有一個protected標籤和其他protected控件。我想隱藏導出控件的這個標籤。所以我在用戶代碼文件以及DerivedUserControl
訪問processMouseMotionEvent我試圖在JFrame中的組件中模擬鼠標,並且我遇到了processMouseMotionEvent。據說我可以通過一個MouseEvent這個,它將處理組件中的MouseEvent。我試過,但我得到一個錯誤: processMouseMotionEvent(MouseEvent) has protected access in JComponent