# Drawing a outline of a country?

• 10-07-2012, 05:17 AM
Frijj
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

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
• 10-07-2012, 05:56 AM
Fubarable
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
• 10-07-2012, 06:31 AM
DarrylBurke
Re: Drawing a outline of a country?