radiobuttonlistener.java.bak

来自「这是JAVA入门程序」· BAK 代码 · 共 49 行

BAK
49
字号
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class RadioButtonListener implements ActionListener
{
	DrawGUI x;
	
	RadioButtonListener(DrawGUI a)
	{
		x = a;
	}
	
	public void actionPerformed(ActionEvent e)
	{
		if(e.getActionCommand().equals("English Student"))
		{
			x.txtMidterm.setVisible(true);
			x.txtFinalExam.setVisible(true);
			x.txtResearch.setVisible(true);
			x.txtPresentation.setVisible(true);
			x.lblStudentType.setText("ENGLISH STUDENT");
		}
		
		if(e.getActionCommand().equals("Math Student"))
		{
			x.txtMidterm.setVisible(true);
			x.txtFinalExam.setVisible(true);
			x.txtResearch.setVisible(false);
			x.txtPresentation.setVisible(false);
			x.lblStudentType.setText("MATH STUDENT");
		}
		
		if(e.getActionCommand().equals("Science Student"))
		{
			x.txtMidterm.setVisible(true);
			x.txtFinalExam.setVisible(true);
			x.txtResearch.setVisible(true);
			x.txtPresentation.setVisible(false);
			x.lblStudentType.setText("SCIENCE STUDENT");
		}
		
		if(e.getActionCommand().equals("Calculate Grade"))
		{
			System.out.println("hahahahhahahahhahhahhahahh");	
		}
	}

}

⌨️ 快捷键说明

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