Java:
package xy
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.NumberFormat;
import javax.swing.*;
import javax.swing.text.NumberFormatter;
public class frame implements ActionListener
{
public static void main(String[] args)
{
// TODO Auto-generated method stub
JLabel Damage;
JLabel Accuracy;
JLabel BPM;
JLabel MagKap;
JLabel Reloadingtime;
JFormattedTextField Schaden;
JFormattedTextField Genauigkeit;
JFormattedTextField FeuerRate;
JFormattedTextField MagAmmo;
JFormattedTextField Nachladezeit;
JFrame screen = new JFrame ("Menue");
screen.setSize(600, 600);
screen.setLayout(new FlowLayout());
JToolBar tbar1 = new JToolBar (null, JToolBar.VERTICAL);
JToolBar tbar2 = new JToolBar (null, JToolBar.VERTICAL);
NumberFormat format = NumberFormat.getInstance();
format.setGroupingUsed(false);
NumberFormatter formatter = new NumberFormatter(format);
formatter.setAllowsInvalid(false);
Damage = new JLabel ("Damage ");
Damage.setOpaque(true);
Schaden = new JFormattedTextField ("Schaden");
Accuracy = new JLabel ("Accuracy ");
Accuracy.setOpaque(true);
Genauigkeit = new JFormattedTextField ("Genauigkeit");
BPM = new JLabel ("BPM ");
BPM.setOpaque(true);
FeuerRate = new JFormattedTextField ("BPM");
MagKap = new JLabel ("MagKap ");
MagKap.setOpaque(true);
MagAmmo = new JFormattedTextField ("Magazin Grösse");
Reloadingtime = new JLabel ("Reloadingtime ");
Reloadingtime.setOpaque(true);
Nachladezeit = new JFormattedTextField ("Nachlade Zeit");
tbar1.add(Damage);
tbar1.add(Accuracy);
tbar1.add(BPM);
tbar1.add(MagKap);
tbar1.add(Reloadingtime);
tbar2.add(Schaden);
tbar2.add(Genauigkeit);
tbar2.add(FeuerRate);
tbar2.add(MagAmmo);
tbar2.add(Nachladezeit);
{
int a = 2900;
if (a>20)
Damage.setText ("Schlechterer schaden");
else Damage.setText("Besserer schaden");
}
{
int b =96;
if (b>80)
Accuracy.setText ("Unpräzieser");
else
Accuracy.setText ("Präzieser");
}
{
int c = 110;
if(c>100)
BPM.setText("Schlechtere Feuerrate");
else
BPM.setText("Bessere Feuerrtate");
}
{
int d = 50;
if (d>20)
MagKap.setText("Kleineres Magazin");
else
MagKap.setText("Größeres Magzin");
}
{
int e = 3;
if (e>2)
Reloadingtime.setText("Bessere Nachladezeit");
else
Reloadingtime.setText("Schlechtere Nachladezeit");
}
screen.add(tbar1);
screen.add(tbar2);
screen.setVisible(true);}
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
}