일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- dock
- 가우스
- Eclipse
- JSON
- jsr 296
- Ajax
- oracle
- Spring
- JDOM
- Google Map
- Android
- tomcat
- WebLogic
- sencha touch
- phonegap
- jQuery
- MySQL
- node.js
- PLSQL
- GPS
- iBATIS
- PHP
- Struts
- ibsheet
- 선택적조인
- rowspan
- MFC
- 전자정부프레임워크
- swingx
- appspresso
Archives
- Today
- Total
Where The Streets Have No Name
JXLoginPane 예제 본문
import org.jdesktop.swingx.auth.LoginService;
public class DummyLoginService extends LoginService {
@Override
public boolean authenticate(String arg0, char[] arg1, String arg2) throws Exception {
//throw new UnsupportedOperationException("Not supported yet.");
System.out.println("name : " + arg0);
StringBuilder passwd = new StringBuilder();
for (char c : arg1) {
passwd.append(c);
}
System.out.println("password : " + passwd.toString());
System.out.println("server : " + arg2);
if(passwd.toString().equals("9981"))
return true;
else
return false;
}
}
기본적으로 제공되는 로그인창을 사용하는 경우
private void btnLoginMouseClicked(java.awt.event.MouseEvent evt) {
JXLoginPane.Status status = JXLoginPane.showLoginDialog(null, new DummyLoginService());
System.out.println("login status : "+status);
}
사용자가 정의한 로그인 창을 사용하는 경우
private org.jdesktop.swingx.JXLoginPane customerLoginPane;
...
customerLoginPane = new org.jdesktop.swingx.JXLoginPane();
...
customerLoginPane.setBannerText("Customer Login");
private void btnLoginMouseClicked(java.awt.event.MouseEvent evt) {
customerLoginPane.setLoginService(new DummyLoginService());
JXLoginPane.Status status = JXLoginPane.showLoginDialog(null,customerLoginPane);
System.out.println("login status : "+status);
}