Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable-MaskFormatter  RSS feed

Vege Thokr
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing B&S Assignment. My JTable has a column that can take only 0-9. I'm using a customized cell editor, which is basically a formatted text field (MaskFormatter).
The problem is getValue() returns null, while getText() returns the entered value. Precisely it fails during commitEdit() with ParseException.
I saw one example in Java Tutorial where for a mask formatter they were using getText() directly instead of getValue().
Is it right doing this way or could I be missing something?

Vege Thokr
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!