找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 5436|回复: 0

[求助] NC 按钮状态

[复制链接]
发表于 2009-10-8 00:35:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
在NC中,我在初化时,将按钮设置为 button1.setEnable(false),但是在后面的操作中,始终不法将按钮将灰色设为正常状态,只有在初始化才可以设,请各们高手帮帮忙看看.
   package nc.ui;
import java.awt.Button;
import javax.swing.JComboBox;
import nc.ui.pub.ButtonObject;
import nc.ui.pub.ClientEnvironment;
import nc.ui.pub.ToftPanel;
import nc.ui.pub.bill.BillCardPanel;
import nc.ui.pub.bill.BillEditEvent;
import nc.ui.pub.bill.BillEditListener;
import nc.ui.pub.bill.BillItem;
public class FileViaUI extends ToftPanel implements BillEditListener {
protected BillCardPanel myCardBill;
protected String billType="100402";
private String openFilePath_3;
private String openFilePath_2;
private String openFileName;
private int targ;

private ButtonObject[] allButtonList;
private ButtonObject send = new ButtonObject("发送", "发送模板", 1);
private ButtonObject brush = new ButtonObject("刷新", "刷新模板", 1);
private ButtonObject browse_1=new ButtonObject("数据文件","数据文件",2);
private ButtonObject browse_2=new ButtonObject("回执目录","回执目录",2);
private ButtonObject browse_3=new ButtonObject("加载完成转移目录","加载完成转移目录",2);
public FileViaUI() {
  super();
  try{
    init();
   }catch(Exception e){
    e.printStackTrace();
   }
}
private void init() {
  initButtons();
  initUI();
  getBillCardPanel().setHeadItem("pk_billType", billType);
  setLayout(new java.awt.BorderLayout());
  add(getBillCardPanel(),java.awt.BorderLayout.CENTER);
}


private void initUI(){
send.setEnabled(false);
  System.out.println("isEnable--"+send.isEnabled());
  getBillCardPanel().getHeadItem("URLAddress").setValue("http://127.0.0.1:80/service/XChangeServlet?account=nc5.5&receiver=0001");
   }

private void initButtons() {
  allButtonList = new ButtonObject[] { send, brush,browse_1,browse_2,browse_3 };
  setButtons(allButtonList);
}
protected BillCardPanel getBillCardPanel() {
  if(myCardBill==null)
  {
   try {
    myCardBill=new BillCardPanel();
    ClientEnvironment cd=getClientEnvironment();
    String operator=cd.getUser().getPrimaryKey();
    String pk_corp=cd.getCorporation().getPk_corp();
    myCardBill.loadTemplet(billType,null,operator,pk_corp);
    //增加单据编辑监听
    myCardBill.addEditListener(this);
   
   } catch (java.lang.Throwable ivjExc) {
        ivjExc.printStackTrace();
   }
   
   
  }
  return myCardBill;
}
@Override
public String getTitle() {
  // TODO Auto-generated method stub
  return null;
}
@Override
public void onButtonClicked(ButtonObject button) {
  if(button==send)
  {
   send();
  }
  if(button==brush)
  {
   brush();
  }
  if(button==browse_1)
  {
   browse_1();
  }
  if(button==browse_2)
  {
   browse_2();
  }
  if(button==browse_3)
  {
   browse_3();
  }
}


private void browse_3() {
  openFilePath_3=new OpenUI().getFileDir();
  getBillCardPanel().getHeadItem("successmove").setValue(openFilePath_3);
  targ++;
  if(targ==3)
   {
   send.setEnabled(true);
    targ=3;
   }
  
  
}
private void browse_2() {
  openFilePath_2=new OpenUI().getFileDir();
  getBillCardPanel().getHeadItem("ts").setValue(openFilePath_2);
  targ++;
  if(targ==3)
   {
    send.setEnabled(true);
    targ=3;
   }
}

private void browse_1() {
  openFileName=new OpenUI().getFileName();
  getBillCardPanel().getHeadItem("currbusidigit").setValue(openFileName);
  targ++;
  if(targ==3)
   {
    send.setEnabled(true);
    targ=3;
   }
}
private void brush() {
  // TODO Auto-generated method stub
      send.setEnabled(true);
       System.out.println("isEnable--"+send.isEnabled());     //在此打印出来的为true,但是按钮不为正常状态
}

private void send() {
  // TODO Auto-generated method stub
  
}


public void afterEdit(BillEditEvent arg0) {
  // TODO Auto-generated method stub
}
public void bodyRowChange(BillEditEvent arg0) {
  // TODO Auto-generated method stub
}

public ButtonObject getSend() {
  return send;
}
}
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-11-15 14:25 , Processed in 0.041833 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表