| | |
jigsaw tutorial
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jun 2009
Posts: 27
Reputation:
Solved Threads: 0
Good evening,
I have the need to learn how to make a picture jigsaw with java.
I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with.
Would somebody have a suggestion?
perhaps a site?
A java tutorial on how to do a picture jigsaw?
Thank you,
John
I have the need to learn how to make a picture jigsaw with java.
I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with.
Would somebody have a suggestion?
perhaps a site?
A java tutorial on how to do a picture jigsaw?
Thank you,
John
•
•
Join Date: Jan 2008
Posts: 3,836
Reputation:
Solved Threads: 503
•
•
•
•
Good evening,
I have the need to learn how to make a picture jigsaw with java.
I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with.
Would somebody have a suggestion?
perhaps a site?
A java tutorial on how to do a picture jigsaw?
Thank you,
John
Like a jigsaw puzzle where you have a picture and then split it into smaller pictures and move the pieces around and put them together? I've never done one, never seen a tutorial for one, but I have though a lot about the subject and have been planning to write one for fun, though I have not yet.
My approach would be to split a large rectangle into smaller shapes from the Shape class. Easiest would be just smaller rectangles, but you can get much more elaborate. You have the
contains and intersects methods from the Shape class. Use those methods to see whether a particular coordinate is contained inside the Shape. Have a MouseListener and drag the shapes around using mousePressed and mouseDragged. If two adjacent Shapes are next to each other in the overall picture and are "close enough" to each other when mouseReleased is called, fuse them into one Shape. When there's only one Shape left, the puzzle is solved.The main functions are the functions that breaks an image into Shapes, breaks Shapes into smaller Shapes, and fuses Shapes together. How to do this depends on your Java experience. That's the approach I plan on taking when I get around to writing it, at least.
•
•
Join Date: Jun 2009
Posts: 27
Reputation:
Solved Threads: 0
Thanks for reminding me of the javaFX tutorial.
I did stumble also upon it but I would have liked to stay within the regular java code.
I did find one source code example but it's not a tutorial, so I guess it will be a lot of figuring out on my own.
Just in case for reference the address is:
http://www.dreamincode.net/forums/in...5247&hl=jigsaw
I did stumble also upon it but I would have liked to stay within the regular java code.
I did find one source code example but it's not a tutorial, so I guess it will be a lot of figuring out on my own.
Just in case for reference the address is:
http://www.dreamincode.net/forums/in...5247&hl=jigsaw
![]() |
Similar Threads
- C++ Tutorial (C++)
- Windows Api Tutorial (C++)
Other Threads in the Java Forum
- Previous Thread: Sentence case changer
- Next Thread: Date question
| Thread Tools | Search this Thread |
Tag cloud for Java
affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth businessintelligence chat class classes client code component csv database desktop draw ebook eclipse equation error event exception fractal game givemetehcodez graphics gui html ide image input integer intersect iphone j2me java java.xls javaexcel javaprojects jmf jni jpanel julia linked linux list loop mac main map method methods mobile netbeans newbie number online open-source oracle parameter print problem program programming project properties recursion reference replaysolutions reporting rotatetext scanner screen scrollbar server set size sms socket sort sql string superclass swing template test threads time tree windows working xstream






