ActionVelocityWindow.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:etomica 作者:
public void actionPerformed() {
    JFrame f = new JFrame();
    TextArea textArea = new TextArea();
    textArea.setEditable(false);
    textArea.setBackground(Color.white);
    textArea.setForeground(Color.black);
    int nLeaf = leafList.getAtomCount();
    for (int iLeaf=0; iLeaf<nLeaf; iLeaf++) {
        IAtomKinetic a = (IAtomKinetic)leafList.getAtom(iLeaf);
        Vector vel = a.getVelocity();
        String str = Double.toString(vel.getX(0));
        for (int i=1; i<vel.getD(); i++) {
            str += " "+Double.toString(vel.getX(i));
        }
        textArea.append(str+"\n");
    }
    f.add(textArea);
    f.pack();
    f.setSize(400,600);
    f.setVisible(true);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号