常用Function

String strDate2=datetime.getTime("YYYY/mm/dd h:m:s");

日期格式化

1.月/日 時:分 value為smalldatetime
if (value.length() >=10){
value=convert.replace(value.substring(5,16),"-","/");
}

訊息視窗

int ans=JOptionPane.showConfirmDialog(null,"xxxx","系統訊息",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
if (ans==JOptionPane.YES_OPTION){

}else if (ans==JOptionPane.NO_OPTION){

}

JOptionPane.showMessageDialog(null,"必填欄位不可空白。","訊息",JOptionPane.ERROR_MESSAGE);

另開視窗

法一:
showDialog(String 表單名稱,"",false,true, int X位置,int Y位置,int 長,int 寬);

showDialog("產線作業記錄","",false,false,280,50,420,580);

JDialog ff=(JDialog)getButton((getName())).getRootPane().getParent();
ff.setVisible(false) ;


 

Copyright 2006| Blogger Templates by GeckoandFly modified and converted to Blogger Beta by Blogcrowds.
No part of the content or the blog may be reproduced without prior written permission.