forked from IF-LK-2020/rechenmaschine
kleine Anpassung der UI
This commit is contained in:
parent
320a48bfea
commit
70ddae16be
1
GUI.form
1
GUI.form
|
@ -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"/>
|
<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>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
|
<font/>
|
||||||
<text value="Ergebnis"/>
|
<text value="Ergebnis"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
|
|
12
GUI.java
12
GUI.java
|
@ -19,6 +19,17 @@ public class GUI extends JFrame {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
//TODO: Text vom Text field zu Eingabe übergeben
|
//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());
|
Rechenmaschine rechner = new Rechenmaschine(textFieldRechenterm.getText());
|
||||||
labelErgebnis.setText("Das Ergebnis ist: "+rechner.getResult());
|
labelErgebnis.setText("Das Ergebnis ist: "+rechner.getResult());
|
||||||
}
|
}
|
||||||
|
@ -27,6 +38,7 @@ public class GUI extends JFrame {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
JFrame frame = new GUI("Rechenterme");
|
JFrame frame = new GUI("Rechenterme");
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue