Problem: solve the following Source of SHORTEST DISTANCE path of A,B,C,D,E,F,G.
I already did link the strings of dots of ABCDEFG and made a polygon which is the other objectives, my only problem now is calculating the source of the shortest distance part of A,B,C,D,E,F,G.
Am using net beans. Guys can you please help me? am very much confused.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author User
*/
public class paths{
}
import java.awt.Color;
import java.awt.Graphics;
import java.swing.*;
public class paths
{
private static void main{({String args[]}
{
myFrame g=newFame ()
coor = new int[][]{{300,400},{200,120},{170,50}{80,76}{143,100},{92,130},{55,50},{300,140}};
g.repaint();
}
static class myFrame extends JFrame
{
public myFrame()
{
setDefaultOperation(JFrame.EXIT_ON_CLOSE);
setSize(450,200);
setVisible(true);
}
public void paint(Grapics.g)
{
char a[]=new char[]{'a','b','c','d','e','f','g'};
g.setColor(Color.blue);
for(int i=0;<7;i++)
g.drawLine(coor[o],coor[1],coor[i+1][o],coor[i+1][1]);
for(int x=0;x<8;x++){
g.setColor(Color.RED);
g.fillOval(coor[x][o]-5,coor[x][1]-5,10,10);
g.setColor(Color.BLACK);ra
g.drawCharts(a,x,1 coor[x][o]-5,coor[x][1]-5);
}
Any help would be appreciated much! thank you!