~ubuntu-branches/ubuntu/natty/libswingx-java/natty

« back to all changes in this revision

Viewing changes to src/demo/org/jdesktop/swingx/JXLoginPaneDemo.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2010-07-26 12:11:27 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100726121127-k0d3b21nhja0dn93
Tags: 1:1.6.1-1
* New upstream release.
* Switch to 3.0 (quilt) format.
* Bump Standards-Version to 3.9.1: no changes needed.
* Drop Depends on JRE: not requested anymore by new Java Policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3
 
 * California 95054, U.S.A. All rights reserved.
4
 
 * 
5
 
 * This library is free software; you can redistribute it and/or modify it under
6
 
 * the terms of the GNU Lesser General Public License as published by the Free
7
 
 * Software Foundation; either version 2.1 of the License, or (at your option)
8
 
 * any later version.
9
 
 * 
10
 
 * This library is distributed in the hope that it will be useful, but WITHOUT
11
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
 
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
 
 * details.
14
 
 * 
15
 
 * You should have received a copy of the GNU Lesser General Public License
16
 
 * along with this library; if not, write to the Free Software Foundation, Inc.,
17
 
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
 
 */
19
 
package org.jdesktop.swingx;
20
 
 
21
 
import java.util.Arrays;
22
 
 
23
 
import javax.swing.JFrame;
24
 
 
25
 
import org.jdesktop.swingx.JXLoginPane.SaveMode;
26
 
 
27
 
/**
28
 
 * Simple demo to show Login Pane..
29
 
 * 
30
 
 * @author rah003
31
 
 */
32
 
public class JXLoginPaneDemo  {
33
 
 
34
 
    public static void main(String[] args) throws Exception {
35
 
        try {
36
 
            JXLoginPane panel = new JXLoginPane();
37
 
            JFrame frame = JXLoginPane.showLoginFrame(panel);
38
 
            panel.setSaveMode(SaveMode.BOTH);
39
 
            
40
 
            frame.pack();
41
 
            frame.setVisible(true);
42
 
            
43
 
            // server combo
44
 
            panel = new JXLoginPane();
45
 
            panel.setServers(Arrays.asList(new String[] {"server1","server2"}));
46
 
            frame = JXLoginPane.showLoginFrame(panel);
47
 
            panel.setSaveMode(SaveMode.BOTH);
48
 
            
49
 
            frame.pack();
50
 
            frame.setVisible(true);
51
 
        } catch (Exception e) {
52
 
            System.err.println("exception when executing interactive tests:");
53
 
            e.printStackTrace();
54
 
        }
55
 
    }
56
 
    
57
 
    
58
 
    
59
 
}