• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Drag and Drop error

 
Greenhorn
Posts: 15
Eclipse IDE PHP Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heey guys im making a drag and drop applic with swing but at the and i got this error

Bound mismatch: The generic method createDragGestureRecognizer(Class<T>,
DragSource, Component, int, DragGestureListener) of type Toolkit is not applicable
for the arguments (Class<capture#1-of ?>, DragSource, Draggable, int,
Draggable.DGListener). The inferred type capture#1-of ? is not a valid substitute for
the bounded parameter <T extends DragGestureRecognizer>

the error code :


i dont know what to do can some one plzz help me thanks !! ^^
 
Greenhorn
Posts: 14
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first suggestion - try to check is "MousedragGestureRecognizer" is correct name. Maybe it should be "MouseDragGestureRecognizer"?
 
Niko Prinz
Greenhorn
Posts: 15
Eclipse IDE PHP Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michal Plutynski wrote:first suggestion - try to check is "MousedragGestureRecognizer" is correct name. Maybe it should be "MouseDragGestureRecognizer"?



If i change i got the same error massage and it it say change it back
 
Michal Plutynski
Greenhorn
Posts: 14
jQuery Eclipse IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok. i answered too fast

the problem is about method Class.forName(...), bacause the return type is Class<?> and what you need is typed class (Class<T>).

the solution is to use:
getToolkit().createDragGestureRecognizer(MouseDragGestureRecognizer.class, source, this, dragAction, listener);

I found the orginal code on internet with this code. My suggestion is to check which Java version the code refers to, this code was created around 1999 - so it is very old!
Try to find some examples of Java 7.
 
Niko Prinz
Greenhorn
Posts: 15
Eclipse IDE PHP Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you ver much it helps alot i know its a old example im working with thinking in java 2
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic