PTV热力学计算助手

    给学弟做的一个小作业,根据学弟给的文档做的,慎抄。

    基本就是按照学弟给的资料里面的公式,数据,要求用户输入数据,并计算给出相应的结果,也没什么技术含量,说明都在代码里,就不重复了。

    软件包下载地址及提取密码请到【我的下载】中下载,软件包含试用版小软件的安装包、使用示范视频和说明书。

1、学弟给的文档需求

{

一、 第一个界面进行两个选择:【流体的pvt性质计算】【流体的热力学性质计算】

二、 若选择【流体的pvt性质计算】

有以下几个选项:

选择流体性质:【纯气体】【纯饱和液体】【纯压缩液体】【真实气体混合物】

1、 若选择【纯气体】

A、 要求用户输入信息:

【物质名称】【压力P(单位:Pa)】【温度T(单位:K)】【摩尔体积V(单位:)】(压力、温度、体积三选二填写不填的那一项即为所求)

B、 对以下几个选项进行选择:【理想气体方程】【van der Waals 状态方程】【Redlich-Kwong方程】【Soave modified Redlich-Kwong方程】【Peng-Robinson方程】【三参数对比状态维里方程Pitzer】【Tsonopoulos关系式-弱极性】

a、 若选【理想气体方程】

则按照:P*V=R*T计算所求的项。其中R=8.314。

(例如:用户输入V、T的值,则解方程PV=RT得出P的值)

b、 若选【van der Waals 状态方程】

则按照:(P+a/V^2)*(V-b)=R*T计算所求的项。其中R=8.314,a=27/64*(R*Tc)^2,b=1/8*R*Tc/Pc(每种物质的Tc、Pc不同,具体各种物质的Tc、Pc见附录1)

c、 若选【Redlich-Kwong方程】

则按照:P=R*T/(V-b)-a/(T^0.5*V*(V+b))计算。其中R=8.314,a=0.42748*R^2*Tc^2.5/Pc,b=0.08664*R*Tc/Pc

d、 若选【Soave modified Redlich-Kwong方程】

则按照:P=R*T/(V-b)-a(T)/(V*(V+b))计算。其中R=8.314,a(T)=0.42748*R^2*Tc^2/Pc*α(T),α(T)=(1+m*(1-(T/Tc)^0.5))^2,m=0.480+1.574*w-0.176*w^2,b=0.08664*R*Tc/Pc(每种物质的w见附录1)

e、 若选【Peng-Robinson方程】

则按照:P=R*T/(V-b)-a(T)/(V*(V+b)+b*(V-b))计算。其中R=8.314,a(T)=0.45724*R^2*Tc^2/Pc*(1+(0.37646+1.54226*w-0.26992*w^2)*(1-(T/Tc)^0.5))^2,b=0.07780*R*Tc/Pc

f、 若选【三参数对比状态维里方程Pitzer】

则按照:P*V/R/T=1+(0.083-0.422*(Tc/T)^1.6+w*(0.139-0.172*(Tc/T)^4.2))*P/R/T

g、 若选【Tsonopoulos关系式-弱极性】

则按照:P*V/R/T=(0.1445-0.330*(Tc/T)-0.1385*(Tc/T)^2-0.0121*(Tc/T)^3-0.000607*(Tc/T)^8+w*(0.0637+0.331*(Tc/T)^2-0.423*(Tc/T)^3-0.008*(Tc/T)^8))*P/R/T

C、 显示计算数值【P=    Pa】or【T=   K】or 【V=   m^3/mol】

2、若选【纯饱和液体】

A、 要求用户输入信息:

【物质名称】【温度T(单位:K)】

B、 对以下几个选项进行选择:【Rackett方程】【童景山方程】

a、 若选【Rackett方程】

则按照:V=Vc*Zc^(1-T/Tc)^(2/7)(每种物质的Vc、Zc见附录1)

b、 若选【童景山方程】

则按照:V=R*Tc/Pc*exp(-(1.2310+0.8777*β)*(1+(1-T/Tc)^(2/7)))(每种物质的β见附录1)

C、 显示计算数值【V=   m^3/mol】

3、若选择【纯压缩液体】

A、要求用户输入信息:

【物质名称】【温度T(单位:K)】【压力P(单位:Pa)】【饱和状态下液相体积Vs(单位:m^3/mol)】【饱和状态下液相压力Ps(单位:Pa)】

B、对以下选项进行选择:【Thomson-Brobst-Hankinson方程】

按照:V=Vs(1-(0.0861488+0.0344483*w)*ln((P+B)/(Ps+B)))计算。其中B=Pc*(-1+(-9.070217)*(T-T/Tc)^(1/3)+62.45326*(1-T/Tc)^(2/3)+(-135.1102)*(1-T/Tc)+exp(4.79594+0.250047*w+1.14188*w^2)*(1-T/Tc)^(4/3))

C、显示计算数值【V=   m^3/mol】

4、若选择【真实气体混合物】

A、 要求用户输入信息:

【物质1名称】【摩尔分数x1】【物质2名称】【摩尔分数x2】【压力P(单位:Pa)】【温度T(单位:K)】【摩尔体积V(单位:)】(压力、温度、体积三选二填写不填的那一项即为所求)

B、 计算混合性质:

Tc=Tc1*x1+Tc2*x2

Vc=Vc1*x1+Vc2*x2

Pc=Pc1*x1+Pc2*x2

其中物质1和物质2的Tc、Pc、V见附录1

C、对以下几个选项进行选择:【理想气体方程】【van der Waals 状态方程】【Redlich-Kwong方程】【Soave modified Redlich-Kwong方程】【Peng-Robinson方程】【三参数对比状态维里方程Pitzer】【Tsonopoulos关系式-弱极性】

a、若选【理想气体方程】

则按照:P*V=R*T计算所求的项。其中R=8.314。

(例如:用户输入V、T的值,则解方程PV=RT得出P的值)

b、若选【van der Waals 状态方程】

则按照:(P+a/V^2)*(V-b)=R*T计算所求的项。其中R=8.314,a=27/64*(R*Tc)^2,b=1/8*R*Tc/Pc(每种物质的Tc、Pc不同,具体各种物质的Tc、Pc见附录1)

c、若选【Redlich-Kwong方程】

则按照:P=R*T/(V-b)-a/(T^0.5*V*(V+b))计算。其中R=8.314,a=0.42748*R^2*Tc^2.5/Pc,b=0.08664*R*Tc/Pc

d、若选【Soave modified Redlich-Kwong方程】

则按照:P=R*T/(V-b)-a(T)/(V*(V+b))计算。其中R=8.314,a(T)=0.42748*R^2*Tc^2/Pc*α(T),α(T)=(1+m*(1-(T/Tc)^0.5))^2,m=0.480+1.574*w-0.176*w^2,b=0.08664*R*Tc/Pc(每种物质的w见附录1)

e、若选【Peng-Robinson方程】

则按照:P=R*T/(V-b)-a(T)/(V*(V+b)+b*(V-b))计算。其中R=8.314,a(T)=0.45724*R^2*Tc^2/Pc*(1+(0.37646+1.54226*w-0.26992*w^2)*(1-(T/Tc)^0.5))^2,b=0.07780*R*Tc/Pc

f、若选【三参数对比状态维里方程Pitzer】

则按照:P*V/R/T=1+(0.083-0.422*(Tc/T)^1.6+w*(0.139-0.172*(Tc/T)^4.2))*P/R/T

g、若选【Tsonopoulos关系式-弱极性】

则按照:P*V/R/T=(0.1445-0.330*(Tc/T)-0.1385*(Tc/T)^2-0.0121*(Tc/T)^3-0.000607*(Tc/T)^8+w*(0.0637+0.331*(Tc/T)^2-0.423*(Tc/T)^3-0.008*(Tc/T)^8))*P/R/T

D、 显示计算数值【P=    Pa】or【T=   K】or 【V=   m^3/mol】

 

附录1:

化合物名称

Tc

Pc*10^6

w

Vc*10^(-3)

Zc

β

甲烷

190.6

4.600

0.008

99

0.288

0.0096

乙烷

305.4

4.884

0.098

148

0.285

0.0445

丙烷

369.8

4.246

0.152

203

0.152

0.0652

正丁烷

425.2

3.800

0.193

0.274

0.193

0.0790

异丁烷

408.1

3.648

0.176

0.283

0.176

0.0692

正戊烷

469.6

3.374

0.251

304

0.262

0.0985

异戊烷

460.4

3.384

0.227

306

0.271

0.0924

新戊烷

433.8

3.202

0.197

303

0.269

-

正己烷

507.4

2.969

0.296

370

0.260

0.1146

正庚烷

540.2

2.736

0.351

432

0.263

0.1320

正辛烷

568.8

2.482

0.394

492

0.259

0.1454

乙烯

282.4

5.036

0.085

129

0.276

0.0345

丙烯

365.0

4.620

0.148

181

0.275

0.0600

1-丁烯

419.6

4.023

0.187

240

0.277

0.079

1-戊烯

464.7

4.053

0.245

300

0.31

-

醋酸

594.4

5.786

0.454

171

0.200

0.3033

丙酮

508.1

4.701

0.309

209

0.232

0.1945

乙腈

548

4.833

0.321

173

0.184

0.4285

乙炔

308.3

6.140

0.184

113

0.271

0.0766

562.1

4.894

0.212

259

0.271

0.0886

1,3-丁二烯

425

4.327

0.195

221

0.270

0.0860

氯苯

632.4

4.519

0.249

308

0.265

-

环己烷

553.4

4.073

0.213

308

0.273

-

二氯二氟甲烷

385.0

4.124

0.176

217

0.280

-

二乙醚

466.7

3.638

0.281

280

0.262

-

乙醇

516.2

6.383

0.635

167

0.248

0.1191

环氧乙烷

469

7.194

0.200

140

0.258

0.1410

甲醇

512.6

8.096

0.559

118

0.224

0.2556

氯甲烷

416,3

6.677

0.156

139

0.268

0.0991

甲乙酮

535.6

4.154

0.329

267

0.249

0.1521

甲苯

591.7

4.114

0.257

316

0.264

0.1185

三氯氟甲烷

471.2

4.408

0.188

248

0.279

-

三氯三氟乙烷

487.2

3.415

0.252

304

0.256

-

150.8

4.874

-0.004

74.9

0.291

0.0010

584

10.335

0.132

127

0.270

-

417

7.701

0.073

124

0.275

0.0625

氦-4

5.19

0.227

-0.387

57.3

0.301

-

33.2

1,297

-0.22

65.0

0.305

-0.0994

209.4

5.502

-0.002

91.2

0.288

0.0100

44.4

2.756

0

41.7

0.311

-

126.2

3.394

0.040

89.5

0.290

0.0189

154.6

5.046

0.021

73.4

0.288

0.0111

289.7

5.836

0.002

118

0.286

-

405.6

11.277

0.250

72.5

0.242

0.1951

二氧化碳

304.2

7.376

0.225

94.0

0.274

0.0783

二硫化碳

552

7.903

0.115

170

0.293

0.0210

一氧化碳

132.9

3.496

0.049

93.1

0.295

0.0152

四氯化碳

556.4

4.560

0.194

276

0.272

0.0813

氯仿

536.4

5.472

0.216

239

0.293

0.0991

653

14.692

0.328

96.1

0.260

-

氯化氢

324.6

8.309

0.12

81.0

0.249

-

氰化氢

456.8

5.390

0.407

139

0.197

-

硫化氢

373.2

8.937

0.100

98.5

0.284

0.0422

一氧化氮

180

6.485

0.607

58

0.25

-

一氧化二氮

309.6

7.245

0.160

97.4

0.274

-

1314

11.753

0.070

-

-

-

二氧化硫

430.8

7.883

0.251

122

0.268

0.1101

三氧化硫

491.0

8.207

0.41

130

0.26

-

647.3

22.048

0.344

56.0

0.229

0.2558

 

 

 

 

 

主题:热力学计算app

第一部分和第二部分的思路是一样的,麻烦看一下可以实现不?

跪谢!

 }


2、界面及计算效果


3、实现代码

<span style="font-size:18px;">import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Point;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionAdapter;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;



/**界面设置*/
public class window extends JFrame implements ActionListener,ItemListener{
	
	public static void main(String[] args) {
		window win=new window();
		win.setVisible(true);//主面板可见
		win.setAlwaysOnTop(true);//一直在最前面
	}
	
	private static final long serialVersionUID = 1L;
	/** 容器 */
	private Container con = null;
	/**三个主面板*/
	JPanel headPanel,mainPanel,showPanel;
	/**headPanel面板里面的控件*/
	JMenuBar menuBar;
	JMenu ptvMenu,hostMenu;
	JRadioButtonMenuItem[] ptvItem;	
	/**mainPanel里面的面板*/
	JPanel namePanel,name1Panel,name2Panel,pPanel,p1Panel,cPanel,mPanel,m1Panel,
		pro0Panel,pro1Panel,pro2Panel,pro3Panel;
	/**showPanel面板里面的控件*/
	JLabel showAc;
	/**namePanel面板里面的控件*/
	JLabel name;
	JComboBox namebox;
	/**name1Panel面板里面的控件*/
	JLabel name1;
	JComboBox name1box;
	JLabel name1Label;
	JTextArea name1text;
	/**name2Panel面板里面的控件*/
	JLabel name2;
	JComboBox name2box;
	JLabel name2Label;
	JTextArea name2text;
	/**pPanel面板里面的控件*/
	JLabel pLabel;
	JTextArea pText;
	JLabel pLabel1;
	/**p1Panel面板里面的控件*/
	JLabel p1Label;
	JTextArea p1Text;
	JLabel p1Label1;
	/**cPanel面板里面的控件*/
	JLabel cLabel;
	JTextArea cText;
	JLabel cLabel1;
	/**mPanel面板里面的控件*/
	JLabel mLabel;
	JTextArea mText;
	JLabel mLabel1;
	/**m1Panel面板里面的控件*/
	JLabel m1Label;
	JTextArea m1Text;
	JLabel m1Label1;
	/**pro0Panel面板里面的控件*/
	JLabel pro0;
	JComboBox pro0box ;
	/**pro1Panel面板里面的控件*/
	JLabel pro1;
	JComboBox pro1box ;
	/**pro2Panel面板里面的控件*/
	JLabel pro2;
	JComboBox pro2box ;
	/**pro3Panel面板里面的控件*/
	JLabel pro3;
	JComboBox pro3box ;
	/**字体显示格式*/
	Font font=new Font("楷体",Font.BOLD,16);
	Font font1=new Font("楷体",Font.BOLD,13);
	private double inf=Double.MAX_VALUE;
	/**数据**/
	double data[][]={{190.6,4.600,0.008,99,0.288,0.0096},
			{305.4,4.884,0.098,148,0.285,0.0445},
			{369.8,4.246,0.152,203,0.152,0.0652},
			{425.2,3.800,0.193,0.274,0.193,0.0790},
			{408.1,3.648,0.176,0.283,0.176,0.0692},
			{469.6,3.374,0.251,304,0.262,0.0985},
			{460.4,3.384,0.227,306,0.271,0.0924},
			{433.8,3.202,0.197,303,0.269,inf},
			{507.4,2.969,0.296,370,0.260,0.1146},
			{540.2,2.736,0.351,432,0.263,0.1320},
			{568.8,2.482,0.394,492,0.259,0.1454},
			{282.4,5.036,0.085,129,0.276,0.0345},
			{365.0,4.620,0.148,181,0.275,0.0600},
			{419.6,4.023,0.187,240,0.277,0.079},
			{464.7,4.053,0.245,300,0.31,inf},
			{594.4,5.786,0.454,171,0.200,0.3033},
			{508.1,4.701,0.309,209,0.232,0.1945},
			{548,4.833,0.321,173,0.184,0.4285},
			{308.3,6.140,0.184,113,0.271,0.0766},
			{562.1,4.894,0.212,259,0.271,0.0886},
			{425,4.327,0.195,221,0.270,0.0860},
			{632.4,4.519,0.249,308,0.265,inf},
			{553.4,4.073,0.213,308,0.273,inf},
			{385.0,4.124,0.176,217,0.280,inf},
			{466.7,3.638,0.281,280,0.26,inf},
			{516.2,6.383,0.635,167,0.248,0.1191},
			{469,7.194,0.200,140,0.258,0.1410},
			{512.6,8.096,0.559,118,0.224,0.2556},
			{416,3,6.677,0.156,139,0.268,0.0991},
			{535.6,4.154,0.329,267,0.249,0.1521},
			{591.7,4.114,0.257,316,0.264,0.1185},
			{471.2,4.408,0.188,248,0.279,inf},
			{487.2,3.415,0.252,304,0.256,inf},
			{150.8,4.874,-0.004,74.9,0.291,0.0010},
			{584,10.335,0.132,127,0.270,inf},
			{417,7.701,0.073,124,0.275,0.0625},
			{-4,5.19,0.227,-0.387,57.3,0.301,inf},
			{33.2,1,297,-0.22,65.0,0.305,-0.0994},
			{209.4,5.502,-0.002,91.2,0.288,0.0100},
			{44.4,2.756,0,41.7,0.311,inf},
			{126.2,3.394,0.040,89.5,0.290,0.0189},
			{154.6,5.046,0.021,73.4,0.288,0.0111},
			{289.7,5.836,0.002,118,0.286,inf},
			{405.6,11.277,0.250,72.5,0.242,0.1951},
			{304.2,7.376,0.225,94.0,0.274,0.0783},
			{552,7.903,0.115,170,0.293,0.0210},
			{132.9,3.496,0.049,93.1,0.295,0.0152},
			{556.4,4.560,0.194,276,0.272,0.0813},
			{536.4,5.472,0.216,239,0.293,0.0991},
			{653,14.692,0.328,96.1,0.260,inf},
			{324.6,8.309,0.12,81.0,0.249,inf},
			{456.8,5.390,0.407,139,0.197,inf},
			{373.2,8.937,0.100,98.5,0.284,0.0422},
			{180,6.485,0.607,58,0.25,inf},
			{309.6,7.245,0.160,97.4,0.274,inf},
			{1314,11.753,0.070,inf,inf,inf},
			{430.8,7.883,0.251,122,0.268,0.1101},
			{491.0,8.207,0.41,130,0.26,inf},
			{647.3,22.048,0.344,56.0,0.229,0.2558}};
	String[] namet={"甲烷","乙烷","丙烷","正丁烷","异丁烷","正戊烷","异戊烷","新戊烷",
			"正己烷","正庚烷","正辛烷","1-丁烯","1-戊烯","醋酸","丙酮","乙腈","乙炔","苯","1,3-丁二烯",
			"氯苯","环己烷","二氯二氟甲烷","二乙醚","乙醇","环氧乙烷","甲醇","氯甲烷","甲乙酮","甲苯",
			"三氯氟甲烷","三氯三氟乙烷","氩","溴","氯","氦","氢","氪","氖","氮","氧","氙","氨","二氧化碳",
			"二硫化碳","一氧化碳","四氯化碳","氯仿","肼","氯化氢","氰化氢","硫化氢","一氧化氮","一氧化二氮",
			"硫","二氧化硫","三氧化硫","水"}; 
	public window(){//构造函数
		super();
		initSelf();
		combinElems();
	}
	/** 窗口初始化 */
	public void initSelf() {
		//this.setUndecorated(true);//隐藏最大化、最小化、关闭框
		con = this.getContentPane();
		con.setLayout(null);
		this.setSize(600, 500);
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("热力学计算");// 窗口命名
	}
	
	public void combinElems() {
		
		headPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		headPanel.setLayout(new BorderLayout());
		headPanel.setOpaque(false);//透明	
		headPanel.setLocation(0, 0);
		headPanel.setSize(600, 30);
		
		menuBar = new JMenuBar();
		headPanel.add(menuBar);
		
		ptvMenu = new JMenu("流体的pvt性质计算");
		ptvMenu.setFont(font1);
		ptvMenu.setBorder(BorderFactory.createEtchedBorder());
		menuBar.add(ptvMenu);
		
		hostMenu = new JMenu("流体的热力学性质计算");
		hostMenu.setFont(font1);
		hostMenu.setBorder(BorderFactory.createEtchedBorder());
		menuBar.add(hostMenu);
		
		ButtonGroup ptvBg = new ButtonGroup();
		ButtonGroup selectBg = new ButtonGroup();
		
		//定义5个单选框按钮,用以控制表格的宽度调整方式
		ptvItem = new JRadioButtonMenuItem[4];
		ptvItem[0] = new JRadioButtonMenuItem("纯气体");
		ptvItem[0].addActionListener(this);
		ptvItem[1] = new JRadioButtonMenuItem("纯饱和液体");
		ptvItem[1].addActionListener(this);
		ptvItem[2] = new JRadioButtonMenuItem("纯压缩液体");
		ptvItem[2].addActionListener(this);
		ptvItem[3] = new JRadioButtonMenuItem("真实气体混合物");
		ptvItem[3].addActionListener(this);
		for (int i = 0; i < ptvItem.length ; i++)
		{
			//默认选中第三个菜单项,即对应表格默认的宽度调整方式
			if (i == 0)
			{
				ptvItem[i].setSelected(true);
			}
			ptvBg.add(ptvItem[i]);
			ptvMenu.add(ptvItem[i]);
			ptvItem[i].setFont(font);
		}
		
		showAc=new JLabel();
		showAc.setText("当前操作:流体的pvt性质计算-纯气体");
		showAc.setFont(font1);
		showAc.setForeground(Color.black);
		showAc.setBounds(30, 5, 600, 20);
		
		showPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		showPanel.setLayout(null);
		showPanel.setOpaque(false);//透明	
		showPanel.setBounds(0, 435, 600, 30);
		showPanel.setBorder(BorderFactory.createEtchedBorder());
		showPanel.add(showAc);
		
		name=new JLabel();
		name.setText("物质名称:");
		name.setHorizontalAlignment(SwingConstants.CENTER);
		name.setFont(font);
		name.setForeground(Color.black);
		name.setBounds(40, 20, 150, 20);
		
		namebox = new JComboBox(); 
		namebox.setBounds(190, 20, 200, 20);
		namebox.setFont(font);
		namebox.setForeground(Color.black);
		for(int i=0;i<namet.length;i++)
			namebox.addItem(namet[i]);
		
		namePanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		namePanel.setLayout(null);
		namePanel.setOpaque(false);//透明	
		namePanel.setSize(600, 40);
		namePanel.add(name);
		namePanel.add(namebox);
		
		name1=new JLabel();
		name1.setText("物质1名称:");
		name1.setHorizontalAlignment(SwingConstants.CENTER);
		name1.setFont(font);
		name1.setForeground(Color.black);
		name1.setBounds(40, 20, 150, 20);
		
		name1box = new JComboBox(); 
		name1box.setBounds(190, 20, 200, 20);
		name1box.setFont(font);
		name1box.setForeground(Color.black);
		for(int i=0;i<namet.length;i++)
			name1box.addItem(namet[i]);
		
		name1Label=new JLabel();
		name1Label.setText("物质1摩尔分数:");
		name1Label.setHorizontalAlignment(SwingConstants.CENTER);
		name1Label.setFont(font);
		name1Label.setForeground(Color.black);
		name1Label.setBounds(40, 60, 150, 20);
		
		name1text=new JTextArea();
		name1text.setFont(font);
		name1text.setForeground(Color.black);
		name1text.setBounds(190, 60, 200, 20);
		
		name1Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		name1Panel.setLayout(null);
		name1Panel.setOpaque(false);//透明	
		name1Panel.setSize(600, 80);
		name1Panel.add(name1);
		name1Panel.add(name1box);
		name1Panel.add(name1Label);
		name1Panel.add(name1text);
		
		name2=new JLabel();
		name2.setText("物质1名称:");
		name2.setHorizontalAlignment(SwingConstants.CENTER);
		name2.setFont(font);
		name2.setForeground(Color.black);
		name2.setBounds(40, 20, 150, 20);
		
		name2box = new JComboBox(); 
		name2box.setBounds(190, 20, 200, 20);
		name2box.setFont(font);
		name2box.setForeground(Color.black);
		for(int i=0;i<namet.length;i++)
			name2box.addItem(namet[i]);
		
		name2Label=new JLabel();
		name2Label.setText("物质1摩尔分数:");
		name2Label.setHorizontalAlignment(SwingConstants.CENTER);
		name2Label.setFont(font);
		name2Label.setForeground(Color.black);
		name2Label.setBounds(40, 60, 150, 20);
		
		name2text=new JTextArea();
		name2text.setFont(font);
		name2text.setForeground(Color.black);
		name2text.setBounds(190, 60, 200, 20);
		
		name2Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		name2Panel.setLayout(null);
		name2Panel.setOpaque(false);//透明	
		name2Panel.setSize(600, 80);
		name2Panel.add(name2);
		name2Panel.add(name2box);
		name2Panel.add(name2Label);
		name2Panel.add(name2text);
		
	    pLabel=new JLabel();
	    pLabel.setText("压    力:");
	    pLabel.setHorizontalAlignment(SwingConstants.CENTER);
	    pLabel.setFont(font);
	    pLabel.setForeground(Color.black);
	    pLabel.setBounds(40, 20, 150, 20);
	    
	    pText=new JTextArea();
	    pText.setFont(font);
	    pText.setForeground(Color.black);
	    pText.setBounds(190, 20, 200, 20);
	    
	    pLabel1=new JLabel();
	    pLabel1.setText("Pa");
	    pLabel1.setFont(font);
	    pLabel1.setForeground(Color.black);
	    pLabel1.setBounds(400, 20, 50, 20);
	    
	    pPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
	    pPanel.setLayout(null);
	    pPanel.setOpaque(false);//透明	
	    pPanel.setSize(600, 40);
	    pPanel.add(pLabel);
	    pPanel.add(pText);
	    pPanel.add(pLabel1);
	    
	    p1Label=new JLabel();
	    p1Label.setText("液相压力:(饱和状态下)");
	    p1Label.setHorizontalAlignment(SwingConstants.CENTER);
	    p1Label.setFont(font);
	    p1Label.setForeground(Color.black);
	    p1Label.setBounds(40, 20, 150, 20);
	    
	    p1Text=new JTextArea();
	    p1Text.setFont(font);
	    p1Text.setForeground(Color.black);
	    p1Text.setBounds(190, 20, 200, 20);
	    
	    p1Label1=new JLabel();
	    p1Label1.setText("Pa");
	    p1Label1.setFont(font);
	    p1Label1.setForeground(Color.black);
	    p1Label1.setBounds(400, 20, 50, 20);
	    
	    p1Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
	    p1Panel.setLayout(null);
	    p1Panel.setOpaque(false);//透明	
	    p1Panel.setSize(600, 40);
	    p1Panel.add(p1Label);
	    p1Panel.add(p1Text);
	    p1Panel.add(p1Label1);

	    cLabel=new JLabel();
	    cLabel.setText("温    度:");
	    cLabel.setHorizontalAlignment(SwingConstants.CENTER);
	    cLabel.setFont(font);
	    cLabel.setForeground(Color.black);
	    cLabel.setBounds(40, 20, 150, 20);
	    
	    cText=new JTextArea();
	    cText.setFont(font);
	    cText.setForeground(Color.black);
	    cText.setBounds(190, 20, 200, 20);
	    
	    cLabel1=new JLabel();
	    cLabel1.setText("K");
	    cLabel1.setFont(font);
	    cLabel1.setForeground(Color.black);
	    cLabel1.setBounds(400, 20, 50, 20);
	    
	    cPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
	    cPanel.setLayout(null);
	    cPanel.setOpaque(false);//透明	
	    cPanel.setSize(600, 40);
	    cPanel.add(cLabel);
	    cPanel.add(cText);
	    cPanel.add(cLabel1);
	    
	    mLabel=new JLabel();
	    mLabel.setText("摩尔体积:");
	    mLabel.setHorizontalAlignment(SwingConstants.CENTER);
	    mLabel.setFont(font);
	    mLabel.setForeground(Color.black);
	    mLabel.setBounds(40, 20, 150, 20);
	    
	    mText=new JTextArea();
	    mText.setFont(font);
	    mText.setForeground(Color.black);
	    mText.setBounds(190, 20, 200, 20);
	  
	    mLabel1=new JLabel();
	    mLabel1.setText("m^3/mol");
	    mLabel1.setFont(font);
	    mLabel1.setForeground(Color.black);
	    mLabel1.setBounds(400, 20, 80, 20);
	    
	    mPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
	    mPanel.setLayout(null);
	    mPanel.setOpaque(false);//透明	
	    mPanel.setSize(600, 40);
	    mPanel.add(mLabel);
	    mPanel.add(mText);
	    mPanel.add(mLabel1);
	    
	    m1Label=new JLabel();
	    m1Label.setText("液相体积:(饱和状态下)");
	    m1Label.setHorizontalAlignment(SwingConstants.CENTER);
	    m1Label.setFont(font);
	    m1Label.setForeground(Color.black);
	    m1Label.setBounds(40, 20, 150, 20);
	    
	    m1Text=new JTextArea();
	    m1Text.setFont(font);
	    m1Text.setForeground(Color.black);
	    m1Text.setBounds(190, 20, 200, 20);
	  
	    m1Label1=new JLabel();
	    m1Label1.setText("m^3/mol");
	    m1Label1.setFont(font);
	    m1Label1.setForeground(Color.black);
	    m1Label1.setBounds(400, 20, 80, 20);
	    
	    m1Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
	    m1Panel.setLayout(null);
	    m1Panel.setOpaque(false);//透明	
	    m1Panel.setSize(600, 40);
	    m1Panel.add(m1Label);
	    m1Panel.add(m1Text);
	    m1Panel.add(m1Label1);
	    
	    pro0=new JLabel();
	    pro0.setText("使用方程:");
	    pro0.setHorizontalAlignment(SwingConstants.CENTER);
	    pro0.setFont(font);
	    pro0.setForeground(Color.black);
	    pro0.setBounds(40, 20, 150, 20);
		
		pro0box = new JComboBox(); 
		pro0box.setBounds(190, 20, 200, 20);
		pro0box.setFont(font);
		pro0box.setForeground(Color.black);
		pro0box.addItem("理想气体方程");  
		pro0box.addItem("van der Waals 状态方程"); 
		pro0box.addItem("Redlich-Kwong方程");  
		pro0box.addItem("Soave modified Redlich-Kwong方程"); 
		pro0box.addItem("Peng-Robinson方程");  
		pro0box.addItem("三参数对比状态维里方程Pitzer"); 
		pro0box.addItem("Tsonopoulos关系式-弱极性");  
		pro0box.setSelectedIndex(-1);
		pro0box.addItemListener(this);
		
		pro0Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		pro0Panel.setLayout(null);
		pro0Panel.setOpaque(false);//透明	
		pro0Panel.setSize(600, 40);
		pro0Panel.add(pro0);
		pro0Panel.add(pro0box);
		
		pro1=new JLabel();
	    pro1.setText("使用方程:");
	    pro1.setHorizontalAlignment(SwingConstants.CENTER);
	    pro1.setFont(font);
	    pro1.setForeground(Color.black);
	    pro1.setBounds(40, 20, 150, 20);
		
		pro1box = new JComboBox(); 
		pro1box.setBounds(190, 20, 200, 20);
		pro1box.setFont(font);
		pro1box.setForeground(Color.black);
		pro1box.addItem("Rackett方程");  
		pro1box.addItem("童景山方程"); 
		pro1box.setSelectedIndex(-1);
		pro1box.addItemListener(this);
		
		pro1Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		pro1Panel.setLayout(null);
		pro1Panel.setOpaque(false);//透明	
		pro1Panel.setSize(600, 40);
		pro1Panel.add(pro1);
		pro1Panel.add(pro1box);
		
		pro2=new JLabel();
	    pro2.setText("使用方程:");
	    pro2.setHorizontalAlignment(SwingConstants.CENTER);
	    pro2.setFont(font);
	    pro2.setForeground(Color.black);
	    pro2.setBounds(40, 20, 150, 20);
		
		pro2box = new JComboBox(); 
		pro2box.setBounds(190, 20, 200, 20);
		pro2box.setFont(font);
		pro2box.setForeground(Color.black);
		pro2box.addItem("Thomson-Brobst-Hankinson方程");  
		pro2box.setSelectedIndex(-1);
		pro2box.addItemListener(this);
		
		pro2Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		pro2Panel.setLayout(null);
		pro2Panel.setOpaque(false);//透明	
		pro2Panel.setSize(600, 40);
		pro2Panel.add(pro2);
		pro2Panel.add(pro2box);
		
		pro3=new JLabel();
	    pro3.setText("使用方程:");
	    pro3.setHorizontalAlignment(SwingConstants.CENTER);
	    pro3.setFont(font);
	    pro3.setForeground(Color.black);
	    pro3.setBounds(40, 20, 150, 20);
		
		pro3box = new JComboBox(); 
		pro3box.setBounds(190, 20, 200, 20);
		pro3box.setFont(font);
		pro3box.setForeground(Color.black);
		pro3box.addItem("理想气体方程");  
		pro3box.addItem("van der Waals 状态方程"); 
		pro3box.addItem("Redlich-Kwong方程");  
		pro3box.addItem("Soave modified Redlich-Kwong方程"); 
		pro3box.addItem("Peng-Robinson方程");  
		pro3box.addItem("三参数对比状态维里方程Pitzer"); 
		pro3box.addItem("Tsonopoulos关系式-弱极性"); 
		pro3box.setSelectedIndex(-1);
		pro3box.addItemListener(this);
		
		pro3Panel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		pro3Panel.setLayout(null);
		pro3Panel.setOpaque(false);//透明	
		pro3Panel.setSize(600, 40);
		pro3Panel.add(pro3);
		pro3Panel.add(pro3box);
		
		mainPanel = new JPanel();//头顶面板,包括软件名,最小键,关闭键
		mainPanel.setLayout(null);
		mainPanel.setOpaque(false);//透明	
		mainPanel.setLocation(0,30);
		mainPanel.setSize(600, 405);
		
		mainPanel.add(namePanel);
		mainPanel.add(name1Panel);
		mainPanel.add(name2Panel);
		mainPanel.add(pPanel);
		mainPanel.add(p1Panel);
		mainPanel.add(cPanel);
		mainPanel.add(mPanel);
		mainPanel.add(m1Panel);
		mainPanel.add(pro0Panel);
		mainPanel.add(pro1Panel);
		mainPanel.add(pro2Panel);
		mainPanel.add(pro3Panel);
		
		con.add(headPanel);		
		con.add(mainPanel);
		con.add(showPanel);
		show0();
	}
	
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if (e.getSource() ==ptvItem[0])  {
			showAc.setText("当前操作:流体的pvt性质计算-纯气体");
			show0();
		} else if (e.getSource() ==ptvItem[1] ) {
			showAc.setText("当前操作:流体的pvt性质计算-纯饱和液体");
			show1();
		}
		else if (e.getSource() == ptvItem[2]) {
			showAc.setText("当前操作:流体的pvt性质计算-纯压缩液体");
			show2();
		}
		else if (e.getSource() == ptvItem[3]) {
			showAc.setText("当前操作:流体的pvt性质计算-真实气体混合物");
			show3();
		}
	}
	int index;
	int thing,thing1,thing2;//物质序号
	double r=8.314;
	double p,t,v;//常用输入输出,
	double vs,ps;//纯压缩液体  输入
	double x1,x2;//真实气体混合物  输入
	double tc1,pc1,w1,vc1,zc1,b1;//表格数据 Pc*10^6  Vc*10^(-3)
	double tc2,pc2,w2,vc2,zc2,b2;//表格数据 Pc*10^6  Vc*10^(-3)
	double tc,pc,w,vc,zc,b;//表格数据 Pc*10^6  Vc*10^(-3)
	public void itemStateChanged(ItemEvent e) {
		// TODO Auto-generated method stub
		if (e.getSource() ==pro0box ) {//第一种运算操作
			index=pro0box.getSelectedIndex();
			thing=namebox.getSelectedIndex();
			tc=data[thing][0];
			pc=data[thing][1]*0.000001;
			w=data[thing][2];
			//private void caculate(int index,double tc,double pc,double w){
			caculate(index,tc,pc,w);
		}else if (e.getSource() ==pro1box ) {//第二种运算操作
			index=pro1box.getSelectedIndex();
			if(0==index){
			//V=vc*zc^(1-t/tc)^(2/7)
				thing=namebox.getSelectedIndex();
				tc=data[thing][0];
				vc=data[thing][3]*1000;
				zc=data[thing][4];
				t=Double.parseDouble(cText.getText());
				v=vc*Math.pow(Math.pow(zc,(1-t/tc)),((double)2/7));
				mPanel.setVisible(true);
				mPanel.setLocation(0, 180);
				mText.setText(String.valueOf(v));
			}else{
				//V=r*tc/pc*exp(-(1.2310+0.8777*b)*(1+(1-t/tc)^(2/7)))
				thing=namebox.getSelectedIndex();
				tc=data[thing][0];
				pc=data[thing][1]*0.000001;
				b=data[thing][5];
				v=r*tc/pc*Math.exp(-(1.2310+0.8777*b)*(1+Math.pow((1-t/tc),((double)2/7))));
				mPanel.setVisible(true);
				mPanel.setLocation(0, 180);
				mText.setText(String.valueOf(v));
			}
		}else if (e.getSource() ==pro2box ) {//第三种运算操作
			//V=Vs(1-(0.0861488+0.0344483*w)*ln((P+B)/(Ps+B)))计算。其中B=Pc*(-1+(-9.070217)*(T-T/Tc)^(1/3)+62.45326*(1-T/Tc)^(2/3)+(-135.1102)*(1-T/Tc)+exp(4.79594+0.250047*w+1.14188*w^2)*(1-T/Tc)^(4/3))
			thing=namebox.getSelectedIndex();
			tc=data[thing][0];
			w=data[thing][2];
			vs=Double.parseDouble(m1Text.getText());
			ps=Double.parseDouble(p1Text.getText());
			p=Double.parseDouble(pText.getText());
			t=Double.parseDouble(cText.getText());
			double b=pc*(-1+(-9.070217)*Math.pow((t-t/tc),(1/3))+62.45326*Math.pow((1-t/tc),((double)2/3))+(-135.1102)*(1-t/tc)+Math.exp(4.79594+0.250047*w+1.14188*w*w)*Math.pow((1-t/tc),((double)4/3)));
			v=vs*(1-(0.0861488+0.0344483*w)*Math.log10((p+b)/(ps+b)));
			mPanel.setVisible(true);
			mPanel.setLocation(0, 310);
			mText.setText(String.valueOf(v));
		}else{//第四种运算操作
			index=pro3box.getSelectedIndex();
			/*	double x1,x2;//真实气体混合物  输入
				double tc1,pc1,w1,vc1,zc1,b1;//表格数据 Pc*10^6  Vc*10^(-3)
				double tc2,pc2,w2,vc2,zc2,b2;//表格数据 Pc*10^6  Vc*10^(-3)*/
			//private void caculate(int index,double tc,double pc,double w){
			/*tc=data[thing][0];
				pc=data[thing][1]*0.000001;
			vc=data[thing][3]*1000;
			*/
			x1=Double.parseDouble(name1text.getText());
			x2=Double.parseDouble(name2text.getText());
			thing1=name1box.getSelectedIndex();
			thing2=name2box.getSelectedIndex();
			tc1=data[thing1][0];
			pc1=data[thing1][1]*0.000001;
			vc1=data[thing1][3]*1000;
			tc2=data[thing2][0];
			pc2=data[thing2][1]*0.000001;
			vc2=data[thing2][3]*1000;
			tc=tc1*x1+tc2*x2;
			vc=vc1*x1+vc2*x2;
			pc=pc1*x1+pc2*x2;
			caculate(index,tc,pc,w);
		}
	}
	private void caculate(int index,double tc,double pc,double w){
		if(0==index){//理想气体方程
			//P*V=R*T计算所求的项。其中R=8.314。
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=r*t/v;
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				t=p*v/r;
				cText.setText(String.valueOf(t));
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				v=r*t/p;
				mText.setText(String.valueOf(v));
			}
		}else if(1==index){//van der Waals 状态方程//tc,pc,'w','vc','zc','b';//表格数据 Pc*10^6  Vc*10^(-3)
			//(P+27/64*(R*Tc)^2/V^2)*(V-1/8*R*Tc/Pc)=R*T
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=r*t/(v-(double)1/8*r*tc/pc)-(double)27/64*(r*tc)*(r*tc)/(v*v);
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				t=(p+27/64*(r*tc)*(r*tc)/(v*v))*(v-1/8*r*tc/pc)/r;
				cText.setText(String.valueOf(t));
			}else if(mText.getText().equals("")){//求V
				mText.setText("方程太难,先不解了!");
			}
		}else if(2==index){//Redlich-Kwong方程
			//P=r*t/(v-0.08664*r*tc/pc)-0.42748*r^2*tc^2.5/pc/(t^0.5*v*(v+0.08664*r*tc/pc))
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=r*t/(v-0.08664*r*tc/pc)-0.42748*r*r*Math.pow(tc, 2.5)/pc/(Math.sqrt(t)*v*(v+0.08664*r*tc/pc));
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				//t=;
				cText.setText("方程太难,先不解了!");
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				//v=;
				mText.setText("方程太难,先不解了!");
			}
		}else if(3==index){//Soave modified Redlich-Kwong方程
			//P=r*t/(v-0.08664*r*tc/pc)-0.42748*r^2*tc^2/pc*(1+(0.480+1.574*w-0.176*w*w)*(1-Math.sqrt(t/tc)))*(1+(0.480+1.574*w-0.176*w*w)*(1-Math.sqrt(t/tc)))/(v*(v+b))
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=r*t/(v-0.08664*r*tc/pc)-0.42748*r*r*tc*tc/pc*(1+(0.480+1.574*w-0.176*w*w)*(1-Math.sqrt(t/tc)))*(1+(0.480+1.574*w-0.176*w*w)*(1-Math.sqrt(t/tc)))/(v*(v+b));
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				//t=;
				cText.setText("方程太难,先不解了!");
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				//v=;
				mText.setText("方程太难,先不解了!");
			}
		}else if(4==index){//Peng-Robinson方程
			//P=R*T/(V-b)-a(T)/(V*(V+b)+b*(V-b)),a(T)=,
			double b=0.07780*r*tc/pc;
			double a=0.45724*r*r*tc*tc/pc*(1+(0.37646+1.54226*w-0.26992*w*w)*Math.sqrt(1-(t/tc)))*0.45724*r*r*tc*tc/pc*(1+(0.37646+1.54226*w-0.26992*w*w)*(1-Math.sqrt(t/tc)));
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=r*t/(v-b)-a/(v*(v+b)+b*(v-b));
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				//t=;
				cText.setText("方程太难,先不解了!");
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				//v=;
				mText.setText("方程太难,先不解了!");
			}
		}else if(5==index){//三参数对比状态维里方程Pitzer
			//P=(1+(0.083-0.422*(tc/t)^1.6)/(v/r/t-w*(0.139-0.172*(tc/t)^4.2))/r/t)
			double b=0.07780*r*tc/pc;
			double a=0.45724*r*r*tc*tc/pc*(1+(0.37646+1.54226*w-0.26992*w*w)*Math.sqrt(1-(t/tc)))*0.45724*r*r*tc*tc/pc*(1+(0.37646+1.54226*w-0.26992*w*w)*(1-Math.sqrt(t/tc)));
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=(1+(0.083-0.422*Math.pow((tc/t), 1.6))/(v/r/t-w*(0.139-0.172*Math.pow((tc/t), 4.2)))/r/t);
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				//t=;
				cText.setText("方程太难,先不解了!");
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				//v=;
				mText.setText("方程太难,先不解了!");
			}
		}else{//Tsonopoulos关系式-弱极性
			//P=((0.1445-0.330*(tc/t)-0.1385*(tc/t)*(tc/t)-0.0121*(tc/t)*(tc/t)-0.000607*Math.pow((tc/t),8)+w*(0.0637+0.331*(tc/t)^2-0.423*Math.pow((Tc/T),3))/(V/R/T+0.008*Math.pow((Tc/T),8))/r/t)
			if(pText.getText().equals("")){//求P
				v=Double.parseDouble(mText.getText());
				t=Double.parseDouble(cText.getText());
				p=((0.1445-0.330*(tc/t)-0.1385*(tc/t)*(tc/t)-0.0121*(tc/t)*(tc/t)-0.000607*Math.pow((tc/t),8)+w*(0.0637+0.331*(tc/t)*(tc/t)-0.423*Math.pow((tc/t),3))))/(v/r/t+0.008*Math.pow((tc/t),8)/r/t);
				pText.setText(String.valueOf(p));
			}else if(cText.getText().equals("")){//求T
				v=Double.parseDouble(mText.getText());
				p=Double.parseDouble(pText.getText());
				//t=;
				cText.setText("方程太难,先不解了!");
			}else if(mText.getText().equals("")){//求V
				t=Double.parseDouble(cText.getText());
				p=Double.parseDouble(pText.getText());
				//v=;
				mText.setText("方程太难,先不解了!");
			}
		}
	}
	private void show0(){
		namePanel.setVisible(true);
		namePanel.setLocation(0, 20);
		name1Panel.setVisible(false);
		name2Panel.setVisible(false);
		pPanel.setVisible(true);
		pPanel.setLocation(0, 80);
		p1Panel.setVisible(false);
		cPanel.setVisible(true);
		cPanel.setLocation(0, 140);
		mPanel.setVisible(true);
		mPanel.setLocation(0, 200);
		m1Panel.setVisible(false);
		pro0Panel.setVisible(true);
		pro0Panel.setLocation(0, 260);
		pro1Panel.setVisible(false);
		pro2Panel.setVisible(false);
		pro3Panel.setVisible(false);
	}
	private void show1(){
		namePanel.setVisible(true);
		namePanel.setLocation(0, 30);
		name1Panel.setVisible(false);
		name2Panel.setVisible(false);
		pPanel.setVisible(false);
		p1Panel.setVisible(false);
		cPanel.setVisible(true);
		cPanel.setLocation(0, 80);
		mPanel.setVisible(false);
		m1Panel.setVisible(false);
		pro0Panel.setVisible(false);
		pro1Panel.setVisible(true);
		pro1Panel.setLocation(0, 130);
		pro2Panel.setVisible(false);
		pro3Panel.setVisible(false);
	}
	private void show2(){
		namePanel.setVisible(true);
		namePanel.setLocation(0, 10);
		name1Panel.setVisible(false);
		name2Panel.setVisible(false);
		pPanel.setVisible(true);
		pPanel.setLocation(0, 60);
		cPanel.setVisible(true);
		cPanel.setLocation(0, 110);
		mPanel.setVisible(false);
		m1Panel.setVisible(true);
		m1Panel.setLocation(0, 160);
		p1Panel.setVisible(true);
		p1Panel.setLocation(0, 210);
		pro0Panel.setVisible(false);
		pro1Panel.setVisible(false);
		pro2Panel.setVisible(true);
		pro2Panel.setLocation(0, 260);
		pro3Panel.setVisible(false);
	}
	private void show3(){
		namePanel.setVisible(false);
		name1Panel.setVisible(true);
		name1Panel.setLocation(0, 10);
		name2Panel.setVisible(true);
		name2Panel.setLocation(0, 90);
		pPanel.setVisible(true);
		pPanel.setLocation(0, 170);
		p1Panel.setVisible(false);
		cPanel.setVisible(true);
		cPanel.setLocation(0, 210);
		mPanel.setVisible(true);
		mPanel.setLocation(0, 250);
		m1Panel.setVisible(false);
		pro0Panel.setVisible(false);
		pro1Panel.setVisible(false);
		pro2Panel.setVisible(false);
		pro3Panel.setVisible(true);
		pro3Panel.setLocation(0,290);
	}
}

</span>


  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值