From 70ddae16be78473a36332b222afd9e70968f9d10 Mon Sep 17 00:00:00 2001 From: "artem.didytschuk" Date: Mon, 19 Apr 2021 15:30:52 +0200 Subject: [PATCH] kleine Anpassung der UI --- GUI.form | 1 + GUI.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/GUI.form b/GUI.form index 9f0969c..8c3985c 100644 --- a/GUI.form +++ b/GUI.form @@ -37,6 +37,7 @@ + diff --git a/GUI.java b/GUI.java index b278843..e9f19bf 100644 --- a/GUI.java +++ b/GUI.java @@ -19,6 +19,17 @@ public class GUI extends JFrame { @Override public void actionPerformed(ActionEvent e) { //TODO: Text vom Text field zu Eingabe übergeben + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (ClassNotFoundException classNotFoundException) { + classNotFoundException.printStackTrace(); + } catch (InstantiationException instantiationException) { + instantiationException.printStackTrace(); + } catch (IllegalAccessException illegalAccessException) { + illegalAccessException.printStackTrace(); + } catch (UnsupportedLookAndFeelException unsupportedLookAndFeelException) { + unsupportedLookAndFeelException.printStackTrace(); + } Rechenmaschine rechner = new Rechenmaschine(textFieldRechenterm.getText()); labelErgebnis.setText("Das Ergebnis ist: "+rechner.getResult()); } @@ -27,6 +38,7 @@ public class GUI extends JFrame { public static void main(String[] args) { JFrame frame = new GUI("Rechenterme"); + frame.setLocationRelativeTo(null); frame.setVisible(true); }