radiobuttonaction.java

来自「一个简单的图书馆的管理系统,该系统主要是针对学校的图书馆而做的」· Java 代码 · 共 30 行

JAVA
30
字号
package librarymanagement.action.dialogAction;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import librarymanagement.view.dialog.ReturnBookDialog;

public class RadioButtonAction implements ActionListener {

	private ReturnBookDialog returnBook;
	
	public RadioButtonAction(ReturnBookDialog returnBook){
		this.returnBook = returnBook;
	}
	
	public void actionPerformed(ActionEvent e) {
		String name = e.getActionCommand();
		if(name.equals("图书编号:")){
			returnBook.getTextBookID().setEditable(true);
			returnBook.getTextStudentID().setEditable(false);
			returnBook.getTextStudentID().setText("");
		}
		if(name.equals("借书证号:")){
			returnBook.getTextStudentID().setEditable(true);
			returnBook.getTextBookID().setEditable(false);
			returnBook.getTextBookID().setText("");
	}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?