kleine Anpassung der UI

This commit is contained in:
Artem Didytschuk 2021-04-19 15:30:52 +02:00
parent 320a48bfea
commit 70ddae16be
2 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,7 @@
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font/>
<text value="Ergebnis"/>
</properties>
</component>

View File

@ -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);
}