저는 3 차원 공간에서 2 점 사이의 거리를 계산하는 프로그램을 만들고 있습니다. 이제 JFreeChart가 XYZ 축에서이 두 점에 의해 형성된 선을 그려야합니다. 또한이 프로그램은 BlueJ가있는 다른 컴퓨터에서 실행해야하므로 패키지 형식으로 JFreeChart 라이브러리를 가져 오려고합니다. 하지만 Tools \ Preferences \ Libraries에서 external .jars로 추가 할 수조차 못했습니다 (예, BlueJ를 다시 시작했습니다). 그러니이 방법, 구체적으로 패키지로 알려주십시오. 미리 감사드립니다. 내 코드의 일부는 다음과 같습니다.BlueJ에 JFreeChart 파일의 External .jar를 추가하는 방법은 무엇입니까?
String Sx1,Sx2,Sy1,Sy2,Sz1,Sz2;
Sx1=tAX.getText();
Sy1=tAY.getText();
Sz1=tAZ.getText();
Sx2=tBX.getText();
Sy2=tBY.getText();
Sz2=tBZ.getText();
double mx,xi,yi,zi,x1,y1,z1,x2,y2,z2,px,py,pz,dXY,dist,c,mz,cmain,c2;
double re1;
boolean v1=false,v2=false,v3=false,v4=false;
x1=Integer.parseInt(Sx1);
y1=Integer.parseInt(Sy1);
z1=Integer.parseInt(Sz1);
x2=Integer.parseInt(Sx2);
y2=Integer.parseInt(Sy2);
z2=Integer.parseInt(Sz2);
px=Math.abs(x2-x1);
py=Math.abs(y2-y1);
pz=Math.abs(z2-z1);
dXY=Math.sqrt((px*px)+(py*py));
dist=Math.sqrt((dXY*dXY)+(pz*pz));
mx=py/px;
mz=py/pz;
c=y1-(mx*x1);
c2=y1-(mz*z1);
JFrame f2=new JFrame("Answers");
f2.setSize(600,600);
f2.setVisible(true);
f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension dim=Toolkit.getDefaultToolkit().getScreenSize();
f2.setLocation(dim.width/2-f2.getSize().width/2,dim.height/2-f2.getSize().height/2);
JPanel p2=new JPanel(new GridBagLayout());
JLabel L1=new JLabel("The distance between the two points is "+dist);
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=1;
p2.add(L1,gbc);
JLabel L2=new JLabel("The slope of the line on the x axis is "+mx);
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=2;
p2.add(L2,gbc);
if(c!=0)
{
JLabel L3=new JLabel("The equation of the line on the XY plane is: y="+mx+"x+"+c);
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=3;
p2.add(L3,gbc);
}
else
{
JLabel L3=new JLabel("The equation of the line on the XY plane is: y="+mx+"x");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=3;
p2.add(L3,gbc);
}
if(c2!=0)
{
JLabel L4=new JLabel("The equation of the line on the YZ plane is: y="+mz+"z+"+c2);
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=4;
p2.add(L4,gbc);
}
else
{
JLabel L4=new JLabel("The equation of the line on the YZ plane is: y="+mz+"z");
gbc.insets=new Insets(5,5,5,5);
gbc.gridx=0;
gbc.gridy=4;
p2.add(L4,gbc);
}
f2.add(p2);
여기에서 2 방정식에 따라 선을 그려야합니다. 그것에 관한 어떤 조언도 좋을 것입니다! 시작 스크립트 (여기 예제는 Windows 환경에서의)와
감사합니다. 그러나 C :>는 무엇을 의미합니까? – SwingStar123
Windows 운영 체제에서 하드 디스크의 C 드라이브 또는 기본 이름입니다. 명령 자체는 입력해야하는 'java ...'로 시작합니다. 어떤 운영 체제로 작업하고 있습니까? Unix 기반 환경에서는 대개 C :> 및/또는 달러 기호와 현재 카탈로그 조합 대신 사용자 이름이 표시됩니다. –