diff options
| author | tspitzer | 2013-09-03 15:45:41 +0200 |
|---|---|---|
| committer | tspitzer | 2013-09-03 15:45:41 +0200 |
| commit | 0efa0e77199fef10666fc5f109de21891941e532 (patch) | |
| tree | c0018a94d924db3671eab6cd0ac5c858272b876f | |
| parent | LoginWIndow ohne Funktionalität hinzugefügt (diff) | |
| download | tutor-module-0efa0e77199fef10666fc5f109de21891941e532.tar.gz tutor-module-0efa0e77199fef10666fc5f109de21891941e532.tar.xz tutor-module-0efa0e77199fef10666fc5f109de21891941e532.zip | |
Login mit Funktionalität versehen
| -rw-r--r-- | Dozentenmodul/bin/GUI/LoginWindow.class | bin | 384 -> 3198 bytes | |||
| -rw-r--r-- | Dozentenmodul/bin/Logo_bwLehrpool.png | bin | 29052 -> 0 bytes | |||
| -rw-r--r-- | Dozentenmodul/src/GUI/LoginWindow.java | 96 |
3 files changed, 92 insertions, 4 deletions
diff --git a/Dozentenmodul/bin/GUI/LoginWindow.class b/Dozentenmodul/bin/GUI/LoginWindow.class Binary files differindex b1ef0b4b..66d08de8 100644 --- a/Dozentenmodul/bin/GUI/LoginWindow.class +++ b/Dozentenmodul/bin/GUI/LoginWindow.class diff --git a/Dozentenmodul/bin/Logo_bwLehrpool.png b/Dozentenmodul/bin/Logo_bwLehrpool.png Binary files differdeleted file mode 100644 index b897d9f1..00000000 --- a/Dozentenmodul/bin/Logo_bwLehrpool.png +++ /dev/null diff --git a/Dozentenmodul/src/GUI/LoginWindow.java b/Dozentenmodul/src/GUI/LoginWindow.java index 56b187ed..e272ac2b 100644 --- a/Dozentenmodul/src/GUI/LoginWindow.java +++ b/Dozentenmodul/src/GUI/LoginWindow.java @@ -1,13 +1,101 @@ package GUI;
-public class LoginWindow {
+import java.awt.BorderLayout;
+import java.awt.EventQueue;
+import java.awt.Image;
+
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.border.EmptyBorder;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+import javax.swing.JButton;
+
+import auth.Ldap;
+
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.JPasswordField;
+
+public class LoginWindow extends JFrame {
+
+ private JPanel contentPane;
+ private JTextField username;
+ private JPasswordField pass;
/**
- * @param args
+ * Launch the application.
*/
public static void main(String[] args) {
- // TODO Auto-generated method stub
-
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ LoginWindow frame = new LoginWindow();
+ frame.setVisible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
}
+ /**
+ * Create the frame.
+ */
+ public LoginWindow() {
+ try {
+ //System.out.println(UIManager.getSystemLookAndFeelClassName().toString());
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ setTitle("Dozentenmodul Login");
+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ setBounds(100, 100, 450, 300);
+ contentPane = new JPanel();
+ contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
+ setContentPane(contentPane);
+ contentPane.setLayout(null);
+
+ JLabel imgLabel = new JLabel();
+
+ imgLabel.setBounds(10, 11, 350, 64);
+
+ ImageIcon icon = new ImageIcon("img/Logo_bwLehrpool.png","Logo");
+ Image scaled=icon.getImage().getScaledInstance(350, 64, 0);
+ imgLabel.setIcon(new ImageIcon(scaled));
+ contentPane.add(imgLabel);
+
+ JLabel LabelUser = new JLabel("bwIDM-Benutzername:");
+ LabelUser.setBounds(10, 86, 134, 20);
+ contentPane.add(LabelUser);
+
+ username = new JTextField();
+ username.setBounds(154, 86, 125, 20);
+ contentPane.add(username);
+ username.setColumns(10);
+
+ JLabel LabelPass = new JLabel("bwIDM-Passwort:");
+ LabelPass.setBounds(10, 117, 134, 20);
+ contentPane.add(LabelPass);
+
+ JButton BtnLogin = new JButton("Login");
+ BtnLogin.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent arg0) {
+ Ldap check=new Ldap();
+ check.LdapAuth(username.getText(), new String(pass.getPassword()));
+ }
+ });
+ BtnLogin.setBounds(10, 179, 134, 23);
+ contentPane.add(BtnLogin);
+
+ pass = new JPasswordField();
+ pass.setBounds(154, 117, 125, 20);
+ contentPane.add(pass);
+ }
}
|
