java英文字典代码 java中的字典是什么( 三 )


text2.append(s+"\n"+s1+";"+""+"//"+"该内容已增加?。。?);
}
}
});
//菜单栏修改监听器
JMenuItem updateItem = new JMenuItem("修改词汇");
updateItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U,InputEvent.CTRL_MASK));
updateItem.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没输入所要修改java英文字典代码的内容!请重新输入?。。。?);
else{
String s=text1.getText().trim();
text2.setText(new update().jupdate(text1.getText().trim(),
text2.getText().trim()));
text2.append(s+""+"//"+"该内容已修改?。。?);
}
}
});
//菜单栏删除监听器
JMenuItem deleteItem = new JMenuItem("删除词汇");
deleteItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D,InputEvent.CTRL_MASK));
deleteItem.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没输入所要删除的内容!请重新输入?。。。?);
else{
String s=text1.getText().trim();
text2.setText(new delete().jdelete(text1.getText().trim()));
text2.append(s+""+"//"+"该内容已删除?。。?);
}
}
});
editMenu.add(addItem);
editMenu.add(updateItem);
editMenu.add(deleteItem);
JMenu helpMenu = new JMenu("Help");
helpMenu.setMnemonic('H');
aboutItem = new JMenuItem("About");
aboutItem.setMnemonic('A');
aboutItem.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
new guanyu();
}
});
helpMenu.add(aboutItem);
menubar = new JMenuBar();
setJMenuBar(menubar);
menubar.add(fileMenu);
menubar.add(editMenu);
menubar.add(helpMenu);
//工具栏
label = new JLabel("请输入:");
text1= new JTextField("");
selectButton = new JButton("查询");
//工具栏查询监听器
selectButton.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没有输入查询内容!请重新输入?。。?);
else text2.setText(new select().jselect(text1.getText().trim()));
}
});
//工具栏增加监听器
addButton = new JButton("增加");
addButton.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没有输入内容!请重新增加?。。?);
else
{
String s=text1.getText().trim();
String s1=text2.getText().trim();
text2.setText(new add().jadd(text1.getText().trim(),text2.getText().trim()));
text2.append(s+"\n"+s1+";"+""+"//"+"该内容已增加?。。?);
}
}
});
//工具栏修改监听器
updateButton = new JButton("修改");
updateButton.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没输入所要修改的内容!请重新输入?。。。?);
else{
String s=text1.getText().trim();
text2.setText(new update().jupdate(text1.getText().trim(),
text2.getText().trim()));
text2.append(s+""+"//"+"该内容已修改?。。?);
}
}
});
//工具栏删除监听器
deleteButton = new JButton("删除");
deleteButton.addActionListener(new
AbstractAction(){
public void actionPerformed(ActionEvent event)
{
if(text1.getText().equals(""))
text2.setText("没输入所要删除的内容!请重新输入?。。。?);
else{
String s=text1.getText().trim();

推荐阅读