package com.vci.rmip.code.client.codeapply.Apply410;
|
|
import javax.swing.*;
|
import java.awt.*;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.util.HashMap;
|
import java.util.Map;
|
|
public class TestIntegrateFrame {
|
public static JButton apply = new JButton();
|
public static JTextField text = new JTextField();
|
public static void main(String[] args) {
|
final JFrame j = new JFrame();
|
j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
JPanel p = new JPanel();
|
j.setSize(200, 200);
|
apply.setText("test");
|
apply.setSize(80, 25);
|
text.setPreferredSize(new Dimension(100,25));
|
p.add(text);
|
p.add(apply);
|
j.add(p);
|
j.setLocation(new Point(500,300));
|
j.setVisible(true);
|
apply.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent e) {
|
Map<String, String> map = new HashMap<String, String>();
|
// map.put("原材料替换件", "YUANCAILIAOTIHUANJIAN");
|
// map.put("原材料部件", "1");
|
// map.put("简易示波器", "");
|
map.put("", "YCL");
|
String clsfName = "交付产品";
|
String deptName = "";
|
String [] fields=new String[]{"groupcode"};//属性内部字段
|
String [] values=new String[]{"000002"};//属性值
|
//CodeApplyFor410Dialog dialog = new CodeApplyFor410Dialog(j, clsfName,deptName);
|
CodeApplyFor410Dialog dialog = new CodeApplyFor410Dialog(j, clsfName,deptName,fields,values);
|
String code = dialog.getCodeValue();// 获取集团码/企业码
|
dialog.getAttributeValue("mi");//获取相关返回属性
|
text.setText(code + "_" + dialog.getAttributeValue("name"));
|
System.out.println("code:---"+code+"---");
|
}
|
});
|
}
|
}
|