J2ME Polish 是優秀的第三方 GUI 函式庫,能大幅提升 MIDlet 視覺效果。本文記錄在 NetBeans 5.5 + Mobility Pack 環境下,安裝 J2ME Polish 1.3-beta3 並編譯範例的完整步驟。
J2MEpolish-1.3-beta3.jar(官網或 直接連結)。build.xml 路徑編碼問題導致 UTF-8 錯誤。For Test,取消 Create Hello MIDlet。Samples/menu 內所有檔案複製到專案資料夾覆蓋。source/src 解出覆蓋專案原本的空 src。Refresh Folders,即可看到 de.enough.polish.example 套件。Properties > Build > Libraries & Resources > Add Jar/Zip,加入 J2ME-Polish/import/enough/J2MEpolish-client.jar。Files 視圖,右鍵 build.xml 選擇 Run Target > text。Run Target > j2mepolish,即開始編譯 Menu 範例。WTK 安裝目錄下 apps/UIDemo 同樣包含 build.xml,依上述步驟即可編譯 UIDemo 範例。觀察其原始碼可見大量引用 de.enough.polish.ui.* 等套件,引用即可使用 Polish 元件美化介面。
J2ME Polish 提供豐富的 UI 元件與樣式機制,安裝設定稍繁瑣但一次到位後,開發效率與視覺品質大幅提升。建議開發者嘗試整合至專案中。