HZAU_Parser(五)
ut.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel2.getAccessibleContext().setAccessibleName("");
setSize(new java.awt.Dimension(834, 587));
setLocationRelativeTo(null);
}//
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//响应Open按钮
this.Open();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//响应select按钮
one= this.jTextPane1.getSelectedText();
next=this.jTextPane1.getCaretPosition();
// Graphic t=new Graphic()
showFront(star,en,new Color(0,0,0));
int start=jTextPane1.getSelectionStart();
int end=jTextPane1.getSelectionEnd();
Color t=new Color(255,0,0);
showFront(start,end,t);
star=start;
en=end;
// t.getRed();
this.jTextPane1.setCaretColor(t);
//this.jTextPane1.setForeground(t);//设置字体的颜色
this.jTextPane1.setSelectedTextColor(t);//选中部分的颜色
// this.jTextPane1.setSelectionColor(t);
this.jTextPane2.setText(one);
this.Show();
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//响应next按钮
int i,j=0;
tempString=jTextPane1.getText();
if(tempString.equals("")==true)
{
javax.swing.JOptionPane.showMessageDialog(this, "你尚未打开文件,不能进行下一句标注!", "消息对话框", javax.swing.JOptionPane.INFORMATION_MESSAGE);
return ;
}
i=en;
char[] tem=new char[1000];
while(tempString.charAt(i)!='.')
{
//System.out.println(tempString.charAt(i));
tem[j++]=tempString.charAt(i);
i++;
}
i++;
en=i;
String te=new String(tem);
showFront(star,en,new Color(255,0,0));
star=en-1;
this.jTextPane2.setText(te+".\n");
System.out.println(tem);
}
private void jTextArea1MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
//单击鼠标
String str=jTextArea1.getText();
int t=jTextArea1.getCaretPosition(),i=0,temp;
temp=t;
//i=t;
//System.out.println(t);
/*
int m=t/201;
m=t-m*201;
t=t-m;
* */
while((int)str.charAt(t)==0)
{
t--;
}
while((int)str.charAt(t)!=0&&t>
=1)
{
//System.out.println(t);
t--;
}
if(t!=0)
t++;
// System.out.println(str.charAt(t));
a=new char[200];
b=new String();
while((int)str.charAt(t)!=0)
{
a[i]=str.charAt(t++);
b=b+new String(a[i]+"");
i++;
}
//System.out.println(a);
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//To实体
//jTextField1.setText("");
jTextField1.setText(b);
}
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField2.setText(b);
}
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField3.setText(b);
}
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
//增加按钮
String d="$";
String area3=new String();
if(jTextField1.getText().equals("")==true)
area3+=d+"; ";
else{
area3+=jTextField1.getText();
area3+="; ";
}
if(jTextField2.getText().equals("")==true)
area3+=d+"; ";
else{
area3+=jTextField2.getText();
area3+="; ";
}
if(jTextField3.getText().equals("")==true)
area3+=d;
else{
area3+=jTextField3.getText();
area3+=