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

📄 checkbox.java

📁 基于eclipse的工具开发代码
💻 JAVA
字号:
package com.cownew.uidesigner.components.checkbox;

import java.util.ArrayList;
import java.util.List;

import com.cownew.ctk.common.StringUtils;
import com.cownew.uidesigner.common.CodeGenUtils;
import com.cownew.uidesigner.model.ToggleButton;

public class CheckBox extends ToggleButton
{
	public List<String> generateCode(String parentId)
	{
		List<String> list = new ArrayList<String>();

		StringBuffer line1 = new StringBuffer();
		line1.append("JCheckBox ").append(getId()).append("= new JCheckBox(")
				.append(StringUtils.doubleQuoted(getText())).append(");");
		list.add(line1.toString());

		StringBuffer line2 = new StringBuffer();
		line2.append(getId()).append(".setBounds(").append(
				CodeGenUtils.translateBounds(getBounds())).append(");");
		list.add(line2.toString());

		StringBuffer line3 = new StringBuffer();
		line3.append(getId()).append(".setSelected(").append(isSelected())
				.append(");");
		list.add(line3.toString());

		StringBuffer line4 = new StringBuffer();
		line4.append(parentId).append(".add(").append(getId()).append(");");
		list.add(line4.toString());

		return list;
	}
}

⌨️ 快捷键说明

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