Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Drawing a outline of a country?

  1. #1
    Frijj is offline Member
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default Drawing a outline of a country?

    I am unsure how to make the outline appear, The X co ords are 81, 288, 287, 295, 297, 292, 291, 296, 307, 322, 341, 362, 360, 372, 376, 391, 401, 415, 425, 426, 440, 451, 452, 460, 468, 461, 448, 443, 445, 452, 457, 473, 492, 492, 488, 480, 492, 498, 512, 542, 550, 558, 563, 563, 567, 581, 596, 616, 638, 665, 667, 693, 715, 725, 728, 723, 706, 695, 680, 668, 656, 648, 650, 650, 646, 640, 630, 631, 617, 607, 607, 592, 588, 588, 576, 588, 550, 541, 533, 530, 530, 501, 491, 481, 477, 480, 476, 463, 455, 438, 425, 415, 408, 402, 400, 407, 400, 395, 375, 372, 365, 352, 342, 346, 365, 386, 397, 400, 395, 386, 391, 386, 373, 367, 353, 332, 333, 327, 337, 332, 322, 322, 291, 286, 290, 287, 232, 201, 177, 166, 155, 143, 123, 117, 110, 111, 101, 83, 81, 67, 71, 51, 55, 67, 65, 67, 100, 115, 128, 123, 113, 116, 131, 126, 120, 120, 148, 152, 162, 168, 180, 196, 220, 231, 226, 215, 208, 225, 240, 248, 268, 281,

    and the y co ordinates are 144, 143, 152, 158, 166, 177, 188, 203, 211, 208, 199, 203, 193, 191, 187, 196, 193, 194, 183, 174, 161, 173, 189, 204, 208, 222, 234, 241, 252, 252, 237, 237, 238, 247, 256, 262, 259, 248, 246, 257, 264, 262, 272, 281, 284, 279, 284, 289, 288, 306, 317, 329, 336, 349, 371, 393, 413, 424, 442, 461, 466, 476, 489, 508, 531, 551, 566, 578, 594, 609, 622, 629, 634, 637, 638, 634, 639, 641, 646, 651, 651, 664, 674, 681, 698, 711, 727, 739, 757, 782, 789, 804, 817, 818, 807, 799, 792, 787, 774, 767, 772, 757, 757, 749, 728, 711, 703, 687, 678, 676, 657, 646, 649, 621, 617, 618, 598, 581, 551, 538, 531, 517, 517, 498, 494, 477, 451, 406, 412, 426, 426, 436, 432, 434, 427, 407, 417, 417, 408, 407, 399, 376, 363, 358, 349, 333, 314, 318, 262, 248, 243, 231, 228, 221, 221, 212, 204, 211, 201, 214, 223, 219, 208, 198, 192, 177, 163, 168, 172, 162, 156, 144,

    This is my code

    Java Code:
    Polygon poly = new Polygon(
    new int[] x = {281, 288, 287, 295, 297, 292, 291, 296, 307, 322, 341, 362, 360, 372, 376, 391, 401, 415, 425, 426, 440, 451, 452, 460, 468, 461, 448, 443, 445, 452, 457, 473, 492, 492, 488, 480, 492, 498, 512, 542, 550, 558, 563, 563, 567, 581, 596, 616, 638, 665, 667, 693, 715, 725, 728, 723, 706, 695, 680, 668, 656, 648, 650, 650, 646, 640, 630, 631, 617, 607, 607, 592, 588, 588, 576, 588, 550, 541, 533, 530, 530, 501, 491, 481, 477, 480, 476, 463, 455, 438, 425, 415, 408, 402, 400, 407, 400, 395, 375, 372, 365, 352, 342, 346, 365, 386, 397, 400, 395, 386, 391, 386, 373, 367, 353, 332, 333, 327, 337, 332, 322, 322, 291, 286, 290, 287, 232, 201, 177, 166, 155, 143, 123, 117, 110, 111, 101, 83, 81, 67, 71, 51, 55, 67, 65, 67, 100, 115, 128, 123, 113, 116, 131, 126, 120, 120, 148, 152, 162, 168, 180, 196, 220, 231, 226, 215, 208, 225, 240, 248, 268, 281},
    new int[] y = {144, 143, 152, 158, 166, 177, 188, 203, 211, 208, 199, 203, 193, 191, 187, 196, 193, 194, 183, 174, 161, 173, 189, 204, 208, 222, 234, 241, 252, 252, 237, 237, 238, 247, 256, 262, 259, 248, 246, 257, 264, 262, 272, 281, 284, 279, 284, 289, 288, 306, 317, 329, 336, 349, 371, 393, 413, 424, 442, 461, 466, 476, 489, 508, 531, 551, 566, 578, 594, 609, 622, 629, 634, 637, 638, 634, 639, 641, 646, 651, 651, 664, 674, 681, 698, 711, 727, 739, 757, 782, 789, 804, 817, 818, 807, 799, 792, 787, 774, 767, 772, 757, 757, 749, 728, 711, 703, 687, 678, 676, 657, 646, 649, 621, 617, 618, 598, 581, 551, 538, 531, 517, 517, 498, 494, 477, 451, 406, 412, 426, 426, 436, 432, 434, 427, 407, 417, 417, 408, 407, 399, 376, 363, 358, 349, 333, 314, 318, 262, 248, 243, 231, 228, 221, 221, 212, 204, 211, 201, 214, 223, 219, 208, 198, 192, 177, 163, 168, 172, 162, 156, 144},10);

    Basically what do i do after this to produce the outline? im slightly baffled and dont know how to produce the outline after i created both arrays for the co ordintes

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Drawing a outline of a country?

    The Graphics2D class has a draw method which likely can help you a great deal. Consider drawing this country with this object from within the paintComponent method of a JPanel. For more on this, please check out Performing Custom Painting with Swing

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Drawing a outline of a country?

    Fubarable likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Text Area Outline
    By Psyclone in forum AWT / Swing
    Replies: 4
    Last Post: 02-07-2010, 06:12 AM
  2. Replies: 2
    Last Post: 09-14-2009, 10:25 PM
  3. IPAddress to Country
    By sandeeprao.techno in forum Advanced Java
    Replies: 2
    Last Post: 12-19-2008, 01:39 AM
  4. Creating Outline view
    By Optimus in forum Eclipse
    Replies: 1
    Last Post: 06-03-2008, 02:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •