import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class ButtonFrame extends JFrame {
private JRadioButton[] radioArray;
private ButtonGroup radioGroup;
private JTextField textFeldEinfach, textFeldCheckbox, textFeldRadio;
ButtonFrame(String s) {
super(s);
Container c = getContentPane();
c.setLayout(new GridLayout(20,1));
c.setForeground(Color.black);
JLabel lab;
lab = new JLabel("Rechenzeichen Energiebedarfsberechnung");
lab.setFont(new Font("Arial",Font.BOLD,22));
lab.setForeground(Color.black);
c.add(lab);
lab = new JLabel("Leistungsaufwand des/der alten Server in W:");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldEinfach = new JTextField(28);
textFeldEinfach.setFont(new Font("Arial",Font.BOLD,20));
textFeldEinfach.setForeground(Color.blue);
c.add(textFeldEinfach);
lab = new JLabel(" ");
c.add(lab);
lab = new JLabel("Leistungsaufwand des/der neuen Server in W:");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldCheckbox = new JTextField(28);
textFeldCheckbox.setFont(new Font("Arial",Font.BOLD,20));
textFeldCheckbox.setForeground(Color.blue);
c.add(textFeldCheckbox);
lab = new JLabel(" ");
c.add(lab);
setLocation(0,0);
pack();
setVisible(true);
lab = new JLabel("Anschafungspreis der/das Neuen servers in Euro:");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldEinfach = new JTextField(28);
textFeldEinfach.setFont(new Font("Arial",Font.BOLD,20));
textFeldEinfach.setForeground(Color.blue);
c.add(textFeldEinfach);
lab = new JLabel("Ergebnis:");
lab.setFont(new Font("Arial",Font.BOLD,22));
lab.setForeground(Color.black);
c.add(lab);
lab = new JLabel(" ");
c.add(lab);
setLocation(0,0);
pack();
setVisible(true);
lab = new JLabel("Ergebnis pro jahr");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldEinfach = new JTextField(28);
textFeldEinfach.setFont(new Font("Arial",Font.BOLD,20));
textFeldEinfach.setForeground(Color.blue);
c.add(textFeldEinfach);
lab = new JLabel(" ");
c.add(lab);
setLocation(0,0);
pack();
setVisible(true);
lab = new JLabel("Kosteneinsparung pro Jahr");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldEinfach = new JTextField(28);
textFeldEinfach.setFont(new Font("Arial",Font.BOLD,20));
textFeldEinfach.setForeground(Color.blue);
c.add(textFeldEinfach);
lab = new JLabel(" ");
c.add(lab);
setLocation(0,0);
pack();
setVisible(true);
lab = new JLabel("Amortisation:");
lab.setFont(new Font("Arial",Font.BOLD,20));
lab.setForeground(Color.black);
c.add(lab);
textFeldEinfach = new JTextField(28);
textFeldEinfach.setFont(new Font("Arial",Font.BOLD,20));
textFeldEinfach.setForeground(Color.blue);
c.add(textFeldEinfach);
}
}
public class main {
public static void main(String args[]) throws ClassNotFoundException {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (UnsupportedLookAndFeelException e) {}
catch (IllegalAccessException e) {}
catch (InstantiationException e) {}
catch (ClassNotFoundException e) {};
new ButtonFrame("Arten von Buttons");
}
}