diff options
author | unknown | 2014-04-01 14:08:10 +0200 |
---|---|---|
committer | unknown | 2014-04-01 14:08:10 +0200 |
commit | eda407922b40f482723ad422225d2ab97ff24cfa (patch) | |
tree | 155bd299ec81db549e55cb09f5fc3a286358f593 /Dozentenmodul | |
parent | Bild hinzugefügt (diff) | |
download | tutor-module-eda407922b40f482723ad422225d2ab97ff24cfa.tar.gz tutor-module-eda407922b40f482723ad422225d2ab97ff24cfa.tar.xz tutor-module-eda407922b40f482723ad422225d2ab97ff24cfa.zip |
Focus richtig gesetzt + Check ob Imagename eingetragen ist + Speichern des Namens falls man zurück wechselt auf die Seite
Diffstat (limited to 'Dozentenmodul')
-rw-r--r-- | Dozentenmodul/src/GUI/EingabeImageAllgemein_GUI.java | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/Dozentenmodul/src/GUI/EingabeImageAllgemein_GUI.java b/Dozentenmodul/src/GUI/EingabeImageAllgemein_GUI.java index 8fa942b7..da4f6997 100644 --- a/Dozentenmodul/src/GUI/EingabeImageAllgemein_GUI.java +++ b/Dozentenmodul/src/GUI/EingabeImageAllgemein_GUI.java @@ -56,6 +56,10 @@ public class EingabeImageAllgemein_GUI extends JFrame { //Beendet das Fenster auf X System.exit(0); } + @Override + public void windowOpened(WindowEvent arg0) { + imagename.requestFocusInWindow(); + } }); //Verhindert das Vergrößern des Fensters setResizable(false); @@ -171,14 +175,17 @@ public class EingabeImageAllgemein_GUI extends JFrame { lblImagename.setBounds(10, 31, 125, 20); panel_1.add(lblImagename); + imagename = new JTextField(); imagename.setBackground(Color.WHITE); imagename.setText((String) null); imagename.setColumns(10); imagename.setBounds(145, 31, 350, 20); + imagename.setText(Image.image.getImagename()); //null am Anfang, aber speichert die Eingabe, wenn man zurück kommt zur Seite panel_1.add(imagename); JTextArea txtrGebenSieBitte = new JTextArea(); + txtrGebenSieBitte.setEditable(false); txtrGebenSieBitte.setBackground(SystemColor.menu); txtrGebenSieBitte.setLineWrap(true); txtrGebenSieBitte.setFont(new Font("Tahoma", Font.PLAIN, 12)); @@ -234,8 +241,8 @@ public class EingabeImageAllgemein_GUI extends JFrame { buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane); { - JButton okButton = new JButton("Zur\u00FCck"); - okButton.addActionListener(new ActionListener() { + JButton backButton = new JButton("Zur\u00FCck"); + backButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Image.image.setImagename(imagename.getText()); MainMenue_GUI sr=new MainMenue_GUI(); @@ -243,16 +250,15 @@ public class EingabeImageAllgemein_GUI extends JFrame { dispose(); } }); - okButton.setActionCommand("OK"); - buttonPane.add(okButton); - getRootPane().setDefaultButton(okButton); + backButton.setActionCommand("Cancel"); + buttonPane.add(backButton); } { - JButton cancelButton = new JButton("Weiter"); - cancelButton.addActionListener(new ActionListener() { + JButton continueButton = new JButton("Weiter"); + continueButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //Prüft die Eingabe - if(Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false) + if(imagename.getText().isEmpty()==false && Vorname.getText().isEmpty()==false && Nachname.getText().isEmpty()==false && Hochschule.getText().isEmpty()==false&&EMail.getText().isEmpty()==false) { //Schreibt die Daten in das Model Image.image.setImagename(imagename.getText()); @@ -266,8 +272,9 @@ public class EingabeImageAllgemein_GUI extends JFrame { } } }); - cancelButton.setActionCommand("Cancel"); - buttonPane.add(cancelButton); + continueButton.setActionCommand("OK"); + buttonPane.add(continueButton); + getRootPane().setDefaultButton(continueButton); } } @@ -291,5 +298,5 @@ public class EingabeImageAllgemein_GUI extends JFrame { JMenuItem mntmOtrs = new JMenuItem("OTRS"); mnNewMenu_1.add(mntmOtrs); - } + }//end main } |