我對java有點新,所以... 有人可以告訴我如何利用擺動textfield組件進行數字處理(錢,小數...)嗎? 或有人可以告訴我在哪裏可以找到擺動組件女巫是爲此而設計的嗎? 我建立一個小的ERP應用程序,標準的Swing或SwingX簡單的沒有一個好數字處理 組件)Java Swing - 數字的良好文本字段組件?
(FormattedTextField也是白搭!)
我對java有點新,所以... 有人可以告訴我如何利用擺動textfield組件進行數字處理(錢,小數...)嗎? 或有人可以告訴我在哪裏可以找到擺動組件女巫是爲此而設計的嗎? 我建立一個小的ERP應用程序,標準的Swing或SwingX簡單的沒有一個好數字處理 組件)Java Swing - 數字的良好文本字段組件?
(FormattedTextField也是白搭!)
JSpinner被設計用於數字。但是,您需要從組件中進行什麼樣的數字處理?
我已經基於JFormattedTextField實現了數字字段。
它們還支持最小值和最大值。
也許你發現它們非常有用(庫是開源的):
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JRealNumberField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JDoubleField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JFloatField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedDoubleField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLocalizedFloatField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JWholeNumberField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JByteField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JIntegerField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JLongField.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JShortField.html
主頁:
下載:
http://sourceforge.net/project/showfiles.php?group_id=64833
教程: http://softsmithy.sourceforge.net/lib/docs/tutorial/swing/number/index.html
-Puce
參見http://stackoverflow.com/questions/2511415 – trashgod 2010-11-14 17:52:00
-1,那麼,你的要求究竟是什麼?如果JFormattedTextField不好,那麼問題是什麼,你期望以不同的方式做什麼? – camickr 2010-11-15 00:59:47