Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import javax.swing.*;
- import java.awt.*;
- public class LayoutManager extends JFrame
- {
- public LayoutManager ()
- {
- Dimension lbldim = new Dimension(180,25);
- Dimension btndim = new Dimension(120,30);
- Dimension txtdim = new Dimension(150,25);
- setTitle("Fahrtenbuch");
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- setBounds(300,200,1200,700);
- setResizable(false);
- JPanel north = new JPanel();
- north.setPreferredSize(new Dimension(0,220));
- north.setBackground(Color.ORANGE);
- add(north, BorderLayout.NORTH);
- JLabel northHead = new JLabel("Fahrtenbuch");
- northHead.setFont(new Font("Arial",Font.BOLD,30));
- north.add(northHead);
- JPanel center = new JPanel();
- center.setPreferredSize(new Dimension(0,100));
- center.setBackground(Color.GREEN);
- add(center,BorderLayout.CENTER);
- JLabel lblEmployer = new JLabel("Arbeitgeber:");
- lblEmployer.setFont(new Font("Arial",Font.BOLD,22));
- north.add(lblEmployer);
- JLabel lblDate = new JLabel("Datum:");
- lblDate.setFont(new Font("Arial",Font.BOLD,15));
- lblDate.setPreferredSize(lbldim);
- JTextField txtDate = new JTextField();
- txtDate.setPreferredSize(txtdim);
- JLabel lblDestination = new JLabel("Reiseziel:");
- lblDestination.setFont(new Font("Arial",Font.BOLD,15));
- lblDestination.setPreferredSize(lbldim);
- JTextField txtDestination = new JTextField();
- txtDestination.setPreferredSize(txtdim);
- JLabel lblReason = new JLabel("Zweck der Reise:");
- lblReason.setFont(new Font("Arial",Font.BOLD,15));
- lblReason.setPreferredSize(lbldim);
- JTextField txtReason = new JTextField();
- txtReason.setPreferredSize(txtdim);
- JLabel lbldrivenKilometers = new JLabel("gefahrene Kilometer:");
- lbldrivenKilometers.setFont(new Font("Arial",Font.BOLD,15));
- lbldrivenKilometers.setPreferredSize(lbldim);
- JTextField txtdrivenKilometers = new JTextField();
- txtdrivenKilometers.setPreferredSize(txtdim);
- center.add(lblDate);
- center.add(txtDate);
- center.add(lblDestination);
- center.add(txtDestination);
- center.add(lblReason);
- center.add(txtReason);
- center.add(lbldrivenKilometers);
- center.add(txtdrivenKilometers);
- JPanel bottom = new JPanel();
- bottom.setPreferredSize(new Dimension(0,50));
- bottom.setBackground(Color.ORANGE);
- add(bottom,BorderLayout.SOUTH);
- JButton save = new JButton("Speichern");
- save.setPreferredSize(btndim);
- JButton close = new JButton("Beenden");
- close.setPreferredSize(btndim);
- bottom.add(close);
- bottom.add(save);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement