diff options
| author | Nino Breuer | 2014-10-09 14:52:01 +0200 |
|---|---|---|
| committer | Nino Breuer | 2014-10-09 14:52:01 +0200 |
| commit | 39833fd5db8f92dcc4a34a623b6e4f59cde2e74f (patch) | |
| tree | e4db6866847c11ac27a339a58f2f220bf836490c /dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java | |
| parent | Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff) | |
| download | tutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.tar.gz tutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.tar.xz tutor-module-39833fd5db8f92dcc4a34a623b6e4f59cde2e74f.zip | |
• added possibility to change location of application
• set all JOptionPane positions relative to their parent
• known bug: relative position does not work when clicking "back" in ftpcreateimage
Diffstat (limited to 'dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java index 376369d1..a46431bc 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureAllgemein_GUI.java @@ -4,6 +4,7 @@ import gui.intro.About_GUI; import gui.intro.MainMenue_GUI; import java.awt.Color; +import java.awt.Component; import java.awt.FlowLayout; import java.awt.Font; import java.awt.ScrollPane; @@ -66,6 +67,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { JDateChooser dateChooserstart; Date startDate = new Date(); Date endDate; + Component c = null; private boolean descriptionLengthOK = false; // description may not be // longer than // MAX_DESCRIPTION_LENGTH @@ -84,7 +86,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { /** * Create the dialog. */ - public CreateLectureAllgemein_GUI() { + public CreateLectureAllgemein_GUI(Component formerGUI) { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { @@ -107,7 +109,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { } setTitle("bwLehrpool Suite - Veranstaltung erzeugen"); setBounds(0, 0, 603, 722); - GuiOrganizer.centerGUI(this); + setLocationRelativeTo(formerGUI); getContentPane().setLayout(null); { @@ -214,7 +216,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { public void mouseClicked(MouseEvent arg0) { CreateLectureAllgemein_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(); + MainMenue_GUI main = new MainMenue_GUI(c); main.setVisible(true); } }); @@ -389,7 +391,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { Image.image.setImagename(txtFldVeranstaltungsname .getText()); - MainMenue_GUI sr = new MainMenue_GUI(); + MainMenue_GUI sr = new MainMenue_GUI(c); sr.setVisible(true); dispose(); } @@ -409,7 +411,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { isDateOrderCorrect = false; JOptionPane .showMessageDialog( - null, + c, "Das End-Datum liegt vor dem Start-Datum. Bitte ändern.", "Datum fehlerhaft", JOptionPane.INFORMATION_MESSAGE); @@ -422,7 +424,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { if (dateChooserend.getDate().after(endDate)) { // Datum zu weit weg isDateMaxLifeTimeCorrect = false; - JOptionPane.showMessageDialog(null, + JOptionPane.showMessageDialog(c, "Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n" + endDate, "Datum fehlerhaft", JOptionPane.INFORMATION_MESSAGE); @@ -440,7 +442,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { isAllInformationReady = false; JOptionPane .showMessageDialog( - null, + c, "Bitte geben Sie einen Veranstaltungsnamen und eine Beschreibung ein.", "Datum fehlerhaft", JOptionPane.INFORMATION_MESSAGE); @@ -472,7 +474,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { Image.image.setImagename(txtFldVeranstaltungsname .getText()); - PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(); + PermissionCreateLecture_GUI ev = new PermissionCreateLecture_GUI(c); ev.setVisible(true); dispose(); } @@ -551,11 +553,12 @@ public class CreateLectureAllgemein_GUI extends JFrame { mnNewMenu_Info.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { - JOptionPane.showMessageDialog(null, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(c, HELP_MESSAGE, "Hilfe zu dieser Oberfläche", JOptionPane.INFORMATION_MESSAGE); } }); menuBar.add(mnNewMenu_Info); + c = this; } public Date addDays(Date date, int days) { @@ -571,7 +574,7 @@ public class CreateLectureAllgemein_GUI extends JFrame { // max length is 254 chars if (description.getText().length() >= MAX_DESCRIPTION_LENGTH) { descriptionLengthOK = false; - JOptionPane.showMessageDialog(null, + JOptionPane.showMessageDialog(c, "Die Beschreibung darf max 254 Zeichen enthalten. Aktuell enthält sie " + description.getText().length() + ".", "Beschreibung zu umfangreich", |
