summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/GUI/EingabeSystemDaten.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/GUI/EingabeSystemDaten.java')
-rw-r--r--Dozentenmodul/src/GUI/EingabeSystemDaten.java71
1 files changed, 37 insertions, 34 deletions
diff --git a/Dozentenmodul/src/GUI/EingabeSystemDaten.java b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
index bbbfa98a..f94efbef 100644
--- a/Dozentenmodul/src/GUI/EingabeSystemDaten.java
+++ b/Dozentenmodul/src/GUI/EingabeSystemDaten.java
@@ -3,6 +3,7 @@ package GUI;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
@@ -30,6 +31,7 @@ import com.toedter.calendar.JDateChooser;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
+import javax.swing.JScrollPane;
@SuppressWarnings("serial")
public class EingabeSystemDaten extends JDialog {
@@ -40,11 +42,11 @@ public class EingabeSystemDaten extends JDialog {
sql sql=new sql();
private JTextField Laborname;
JDateChooser dateChooser;
- JTextArea textArea_2;
JDateChooser dateChooser_1;
- JTextArea textArea_1;
Choice choiceOS;
- JTextArea textArea;
+ JTextArea comment;
+ JTextArea shortDesc;
+ JTextArea longDesc;
/**
* Launch the application.
*/
@@ -116,32 +118,14 @@ public class EingabeSystemDaten extends JDialog {
lblKurzbeschreibung.setBounds(10, 67, 150, 20);
contentPanel.add(lblKurzbeschreibung);
- textArea = new JTextArea();
- textArea.setBorder(UIManager.getBorder("TextField.border"));
- textArea.setText(vm.vl.getShortDesc());
- textArea.setBounds(170, 67, 274, 63);
- contentPanel.add(textArea);
-
JLabel lblLangbeschreibung = new JLabel("Langbeschreibung: *");
lblLangbeschreibung.setBounds(10, 139, 150, 20);
contentPanel.add(lblLangbeschreibung);
- textArea_1 = new JTextArea();
- textArea_1.setBorder(UIManager.getBorder("TextField.border"));
- textArea_1.setText(vm.vl.getLongDesc());
- textArea_1.setBounds(170, 141, 274, 152);
- contentPanel.add(textArea_1);
-
JLabel lblKommentar = new JLabel("Kommentar:");
lblKommentar.setBounds(10, 308, 150, 20);
contentPanel.add(lblKommentar);
- textArea_2 = new JTextArea();
- textArea_2.setBorder(UIManager.getBorder("TextField.border"));
- textArea_2.setText(vm.vl.getComment());
- textArea_2.setBounds(170, 304, 274, 63);
- contentPanel.add(textArea_2);
-
JLabel lblBetriebssystem = new JLabel("Betriebssystem: *");
lblBetriebssystem.setBounds(10, 373, 150, 20);
contentPanel.add(lblBetriebssystem);
@@ -175,7 +159,7 @@ public class EingabeSystemDaten extends JDialog {
contentPanel.add(lblVon);
dateChooser = new JDateChooser();
- dateChooser.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser.setDateFormatString("dd.MM.yyyy HH:mm:ss");
dateChooser.setDate(vm.vl.getBegin());
dateChooser.setBounds(204, 404, 140, 20);
contentPanel.add(dateChooser);
@@ -185,7 +169,7 @@ public class EingabeSystemDaten extends JDialog {
contentPanel.add(lblNewLabel_1);
dateChooser_1 = new JDateChooser();
- dateChooser_1.setDateFormatString("dd.MM.yyyy hh:mm:ss");
+ dateChooser_1.setDateFormatString("dd.MM.yyyy HH:mm:ss");
dateChooser_1.setDate(vm.vl.getEnd());
dateChooser_1.setBounds(388, 404, 140, 20);
contentPanel.add(dateChooser_1);
@@ -199,6 +183,21 @@ public class EingabeSystemDaten extends JDialog {
});
btnHinzufgen.setBounds(326, 372, 118, 23);
contentPanel.add(btnHinzufgen);
+ shortDesc=new JTextArea();
+ shortDesc.setText(vm.vl.getShortDesc());
+ JScrollPane scrollPane = new JScrollPane(shortDesc);
+ scrollPane.setBounds(170, 67, 274, 63);
+ contentPanel.add(scrollPane);
+ longDesc=new JTextArea();
+ longDesc.setText(vm.vl.getLongDesc());
+ JScrollPane scrollPane_1 = new JScrollPane(longDesc);
+ scrollPane_1.setBounds(170, 139, 274, 158);
+ contentPanel.add(scrollPane_1);
+ comment=new JTextArea();
+ comment.setText(vm.vl.getComment());
+ JScrollPane scrollPane_2 = new JScrollPane(comment);
+ scrollPane_2.setBounds(170, 308, 274, 59);
+ contentPanel.add(scrollPane_2);
{
JPanel buttonPane = new JPanel();
buttonPane.setBounds(0, 554, 567, 33);
@@ -210,12 +209,12 @@ public class EingabeSystemDaten extends JDialog {
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
vm.vl.setBegin(dateChooser.getDate());
- vm.vl.setComment(textArea_2.getText());
+ vm.vl.setComment(comment.getText());
vm.vl.setEnd(dateChooser_1.getDate());
vm.vl.setLaborname(Laborname.getText());
- vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setLongDesc(longDesc.getText());
vm.vl.setOS(choiceOS.getSelectedItem());
- vm.vl.setShortDesc(textArea.getText());
+ vm.vl.setShortDesc(shortDesc.getText());
EingabeAllgemein ea= new EingabeAllgemein();
ea.setVisible(true);
dispose();
@@ -230,16 +229,23 @@ public class EingabeSystemDaten extends JDialog {
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
vm.vl.setBegin(dateChooser.getDate());
- vm.vl.setComment(textArea_2.getText());
+ vm.vl.setComment(comment.getText());
vm.vl.setEnd(dateChooser_1.getDate());
vm.vl.setLaborname(Laborname.getText());
- vm.vl.setLongDesc(textArea_1.getText());
+ vm.vl.setLongDesc(longDesc.getText());
vm.vl.setOS(choiceOS.getSelectedItem());
- vm.vl.setShortDesc(textArea.getText());
-
+ vm.vl.setShortDesc(shortDesc.getText());
+ if(Laborname.getText().isEmpty()==false&&shortDesc.getText().isEmpty()==false&&longDesc.getText().isEmpty()==false&&dateChooser.getDate()!=null&&dateChooser_1.getDate()!=null)
+ {
EingabeSoftwareDaten ea=new EingabeSoftwareDaten();
ea.setVisible(true);
dispose();
+ }
+ else
+ {
+ JOptionPane.showMessageDialog(null, "Bitte geben Sie alle notwendigen Daten an!",
+ "Error", JOptionPane.ERROR_MESSAGE);
+ }
}
});
cancelButton.setActionCommand("Cancel");
@@ -252,7 +258,7 @@ public class EingabeSystemDaten extends JDialog {
getContentPane().add(separator);
JSeparator separator_1 = new JSeparator();
- separator_1.setBounds(0, 82, 529, 2);
+ separator_1.setBounds(0, 82, 567, 2);
getContentPane().add(separator_1);
JMenuBar menuBar = new JMenuBar();
@@ -273,8 +279,5 @@ public class EingabeSystemDaten extends JDialog {
JMenuItem mntmOtrs = new JMenuItem("OTRS");
mnHilfe.add(mntmOtrs);
-
-
-
}
}