Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.wood14mine.gui;
- import java.awt.Font;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- public class GUI extends JFrame {
- JLabel Text1;
- static JLabel Text2;
- static JLabel TextN;
- static JButton btn1;
- static JButton btn2;
- public GUI() {
- setLayout(null);
- setSize(1200,700);
- setTitle("ACP by Wood14Mine");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- Text1 = new JLabel("ACP | by Wood14Mine");
- Text1.setBounds(50, 2, 400, 100);
- Font schriftart = new Font("Arial", Font.PLAIN, 30);
- Text1.setFont(schriftart);
- add(Text1);
- Text2 = new JLabel("Du bist angemeldet als:");
- Text2.setBounds(800, 2, 400, 100);
- Font schriftart1 = new Font("Arial", Font.PLAIN, 15);
- Text2.setFont(schriftart1);
- add(Text2);
- TextN = new JLabel("Wood14Mine");
- TextN.setBounds(955, 2, 400, 100);
- Font schriftart2 = new Font("Arial", Font.PLAIN, 15);
- TextN.setFont(schriftart2);
- TextN.setVisible(false);
- add(TextN);
- btn1 = new JButton("Login");
- btn1.setBounds(50, 625, 125, 20);
- btn1.addActionListener(new ActionLogin());
- add(btn1);
- btn2 = new JButton("Beenden");
- btn2.setBounds(1025, 625, 125, 20);
- btn2.addActionListener(new ActionClose());
- add(btn2);
- }
- static class ActionClose implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == btn2) {
- System.exit(0);
- }
- }
- }
- static class ActionLogin implements ActionListener {
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == btn1) {
- JFrame GUILogin = new GUILogin();
- GUILogin.setVisible(true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement