⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testnamesetuppanel.java

📁 Java version of ABC/HR comparator v0.5. by schnofler. Runs on Sun JRE 1.5 or later
💻 JAVA
字号:
package abchr.gui;

import abchr.TestNameModule;
import guiutils.FlexibleGridLayout;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

public class TestNameSetupPanel extends JPanel {
	private TestNameModule testNameModule=new TestNameModule("");
	private JTextField nameField=new JTextField(20);

	public TestNameSetupPanel() {
		//super(new LineLayout());
		this.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
		this.setLayout(new FlexibleGridLayout(1,2,10,5,true));
		this.add(new JLabel("Test Name"));
		nameField.getDocument().addDocumentListener(new DocumentListener() {
			public void changedUpdate(DocumentEvent e){updateName();}
			public void insertUpdate(DocumentEvent e){updateName();}
			public void removeUpdate(DocumentEvent e){updateName();}
			private void updateName(){testNameModule.setTestName(nameField.getText());}
		});
		this.add(nameField);
	}

	public void setModel(TestNameModule testNameModule) {
		this.testNameModule=testNameModule;
		nameField.setText(testNameModule.getTestName());
	}
}

⌨️ 快捷键说明

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