2
* Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
3
* California 95054, U.S.A. All rights reserved.
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)
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
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
19
package org.jdesktop.swingx;
21
import java.util.Arrays;
23
import javax.swing.JFrame;
25
import org.jdesktop.swingx.JXLoginPane.SaveMode;
28
* Simple demo to show Login Pane..
32
public class JXLoginPaneDemo {
34
public static void main(String[] args) throws Exception {
36
JXLoginPane panel = new JXLoginPane();
37
JFrame frame = JXLoginPane.showLoginFrame(panel);
38
panel.setSaveMode(SaveMode.BOTH);
41
frame.setVisible(true);
44
panel = new JXLoginPane();
45
panel.setServers(Arrays.asList(new String[] {"server1","server2"}));
46
frame = JXLoginPane.showLoginFrame(panel);
47
panel.setSaveMode(SaveMode.BOTH);
50
frame.setVisible(true);
51
} catch (Exception e) {
52
System.err.println("exception when executing interactive tests:");