• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Disable dropping feature in JSpinner

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I need to avoid dropping of text inside the JSpinner control. Below is my code for custom transferHandler.
Even though canImport method is returning false I am able to drag and drop text into JSpinner.
I searched net but did not find proper solution. Please let me know if any one is having an idea how to do it.



Thanks
Peter
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you tried setting the spinner's
formattedTextfield's allowInvalidCharacters
to false?
(posting from phone, so method name
might not be exact)
 
James Peter
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Below code is working. thanks a lot.


Thanks
Peter
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
correct, but the method belongs to the
formattedTextfield of the spinner.

read the spinner docs to get the formattedTextfield

[edit]
thanks to the previous post being edited, my post now makes no sense.
I replied to the unedited post which said 'couldn't find the method in the JSpinner class'
 
reply
    Bookmark Topic Watch Topic
  • New Topic