Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2009, 04:01 AM
Member
 
Join Date: Jul 2009
Posts: 3
Rep Power: 0
lolmasterzz is on a distinguished road
Default Resizing Coordinates In Applets
Hey guys,

I was wondering how to resize coordinates in a simple java applet. I'm not trying to resize the window. Instead, I'm trying to make the window such that if you resize the coordinates it shows coordinates that weren't visible before.

Thanks!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-10-2009, 04:33 AM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 5,968
Rep Power: 7
Fubarable is on a distinguished road
Default
Please clarify by posting the details of what you are trying to do. Thanks and good luck.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-10-2009, 04:49 AM
Member
 
Join Date: Jul 2009
Posts: 3
Rep Power: 0
lolmasterzz is on a distinguished road
Default
so basically I am doing a nearest neighbor heuristic for the travelling salesman problem. however, my applet window only has a certain range for the coordinates and i want my salesman to visit a coordinate that doesn't show up on my window. Is there a way to resize the coordinates such that this point shows up?

Thanks
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-10-2009, 01:12 PM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 406
Rep Power: 3
tim is on a distinguished road
Default
Welcome lolmasterzz, to Java Forums.

I assume that you draw your coordinates on a graphics object. Add an offset to the points before you draw them. You can use this offset to scroll across the "pane" where you draw your points. So, if the salesman moves to a point off the screen, set the offset such that the salesman is drawn onscreen. Or, you can draw on a large panel that covers all the points. Add this panel to a JScrollPane. When the salesman moves out of view, you can set the view point if the JScrollPane so that the salesman is visible again.

Hope that helps, lolmasterzz. If you like, I could give you an example.
__________________
Eyes dwelling into the past are blind to what lies in the future.

Last edited by tim; 07-10-2009 at 01:14 PM.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-12-2009, 05:17 AM
Member
 
Join Date: Jul 2009
Posts: 3
Rep Power: 0
lolmasterzz is on a distinguished road
Default
alright thanks for help! I'll try it out and see if it works.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing Images in JPanel?? NoNickName New To Java 1 04-09-2009 11:19 PM
JFrame resizing problem Bluefox815 AWT / Swing 6 04-05-2009 12:57 AM
panel resizing kumar_gemi New To Java 3 03-13-2009 03:51 AM
Image Resizing and DPi Rob_ Java Applets 4 11-27-2008 03:21 PM
Image resizing alley Java 2D 2 11-13-2007 11:10 AM


All times are GMT +2. The time now is 07:03 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org