Advertisement
Guest User

GUI

a guest
Apr 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.16 KB | None | 0 0
  1. import java.awt.Button;
  2. import java.awt.Checkbox;
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Frame;
  6. import java.awt.Label;
  7. import java.awt.TextArea;
  8. import java.awt.TextField;
  9. import java.awt.event.ActionEvent;
  10. import java.awt.event.ActionListener;
  11.  
  12. import javax.swing.BorderFactory;
  13. import javax.swing.JButton;
  14. import javax.swing.JCheckBox;
  15. import javax.swing.JFrame;
  16. import javax.swing.JLabel;
  17. import javax.swing.JTable;
  18. import javax.swing.JTextArea;
  19. import javax.swing.JTextField;
  20. import javax.swing.border.CompoundBorder;
  21.  
  22.  
  23.  
  24. public class GUI implements ActionListener
  25. {
  26.     JFrame mainframe=new JFrame("Software für Kalkulationen");
  27.     JLabel ueberschrift=new JLabel();
  28.     JLabel name=new JLabel();
  29.     Button bcalc=new Button();
  30.     Button vcalc=new Button();
  31.        
  32.     public void guierstellen() {
  33.  
  34.            
  35.             mainframe.setBounds(100, 100, 400, 230);
  36.             mainframe.setLayout(null);
  37.             mainframe.setResizable(false);
  38.            
  39.             ueberschrift.setBounds(15,20,500,20);
  40.             ueberschrift.setFont(new Font("Verdana", Font.BOLD,20));
  41.             ueberschrift.setForeground(Color.BLACK);
  42.             ueberschrift.setText("Software für Preiskalkulationen");
  43.                        
  44.             name.setFont(new Font("Verdana", Font.PLAIN,14));
  45.             name.setForeground(Color.BLACK);
  46.             name.setBounds(50,60,500,30);
  47.             name.setText("Wählen Sie aus folgenden Optionen aus:");
  48.    
  49.             bcalc.setFont(new Font("Verdana", Font.PLAIN, 16));
  50.             bcalc.setBounds(65,100,250,30);
  51.             bcalc.setLabel("Bezugspreiskalkulation");
  52.             bcalc.addActionListener(this);
  53.            
  54.            
  55.             vcalc.setFont(new Font("Verdana", Font.PLAIN, 16));
  56.             vcalc.setBounds(65,140,250,30);
  57.             vcalc.setLabel("Verkaufskalkulation");
  58.             vcalc.addActionListener(this);                     
  59.            
  60.             mainframe.setVisible(true);            
  61.             mainframe.add(ueberschrift);
  62.             mainframe.add(name);
  63.             mainframe.add(bcalc);
  64.             mainframe.add(vcalc);
  65.     }
  66.     public void actionPerformed(ActionEvent e)
  67.     {
  68.    
  69.         if (e.getSource()==bcalc)
  70.         {
  71.             Bezugskalkulation bsp=new Bezugskalkulation();
  72.             bsp.guierstellen();
  73.         }
  74.         else if (e.getSource()==vcalc)
  75.         {
  76.             Verkaufskalkulation bsp=new Verkaufskalkulation();
  77.             Verkaufskalkulation.guierstellen();
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement