【文件属性】:
文件名称:数值分析实验 插值法
文件大小:6KB
文件格式:ZIP
更新时间:2016-03-20 13:33:04
插值
数值分析实验 插值法 java版
import java.awt.*;
import java.awt.event.*;
import java.util.StringTokenizer;
import javax.swing.Box;
class chazhifa extends Frame implements ActionListener {
TextArea area, result, result2;
Button butt, butt2, butt3;
Label lab, lab3;
Box box1, box2, box3, box4, box5, box6, box7;
TextField field, field2;
chazhifa() {
super("插值法:");
area = new TextArea(5, 34);
result = new TextArea(4, 8);
result.setEditable(false);
result2 = new TextArea(4, 8);
result2.setEditable(false);
butt = new Button("拉格朗日插值:");
butt3 = new Button("牛顿插值:");
butt2 = new Button("清除");
field = new TextField(5);
field2 = new TextField(5);
lab = new Label("依次输入xi和yi的值:");
lab3 = new Label("输入n和x:");
box2 = Box.createHorizontalBox();
box1 = Box.createVerticalBox();
box3 = Box.createHorizontalBox();
box4 = Box.createHorizontalBox();
box5 = Box.createHorizontalBox();
box6 = Box.createHorizontalBox();
box7 = Box.createVerticalBox();
setLayout(new FlowLayout());
box2.add(lab3);
box2.add(field);
box2.add(field2);
box2.add(butt2);
box3.add(lab);
box4.add(area);
box5.add(butt);
box5.add(butt3);
box6.add(result);
box6.add(result2);
box7.add(Box.createVerticalStrut(6));
box7.add(box2);
box7.add(Box.createVerticalStrut(5));
box7.add(box3);
box7.add(Box.createVerticalStrut(5));
box7.add(box4);
box7.add(Box.createVerticalStrut(5));
box7.add(box5);
box7.add(Box.createVerticalStrut(5));
box7.add(box6);
box7.add(Box.createVerticalStrut(5));
add(box7);
butt.addActionListener(this);
butt2.addActionListener(this);
butt3.addActionListener(this);
validate();
setBounds(200, 200, 300, 330);
setVisible(true);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
【文件预览】:
插值法
----.project(385B)
----src()
--------chazhi.java(4KB)
----.classpath(232B)
----bin()
--------chazhifa.class(4KB)
--------chazhi.class(421B)
--------chazhifa$1.class(607B)