Revert "Delete JauJauGUI.java"

This reverts commit da9086f451
This commit is contained in:
ekresse
2020-11-27 15:58:12 +01:00
parent da9086f451
commit 901b83ffdf

118
src/jaujau/JauJauGUI.java Normal file
View File

@@ -0,0 +1,118 @@
package jaujau;
import java.awt.EventQueue;
import java.awt.Image;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.imageio.ImageIO;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.awt.Component;
import java.awt.Font;
public class JauJauGUI {
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
JauJauGUI window = new JauJauGUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public JauJauGUI() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 783, 762);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout(0, 0));
JPanel panel_top = new JPanel();
panel_top.setPreferredSize(new Dimension(200, 100));
panel_top.setBackground(new Color(0, 0, 128));
frame.getContentPane().add(panel_top, BorderLayout.NORTH);
panel_top.setLayout(new BorderLayout(0, 0));
JLabel lblNewLabel_1 = new JLabel("JauJau");
lblNewLabel_1.setForeground(Color.WHITE);
lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_1.setInheritsPopupMenu(false);
lblNewLabel_1.setIgnoreRepaint(false);
lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 40));
lblNewLabel_1.setVerticalAlignment(SwingConstants.CENTER);
panel_top.add(lblNewLabel_1, BorderLayout.CENTER);
JPanel panel_side = new JPanel();
panel_side.setBackground(new Color(100, 149, 237));
panel_side.setPreferredSize(new Dimension(200, 400));
frame.getContentPane().add(panel_side, BorderLayout.WEST);
panel_side.setLayout(new BorderLayout(0, 0));
JPanel panel_buttons = new JPanel();
panel_buttons.setBackground(new Color(0, 0, 128));
panel_buttons.setPreferredSize(new Dimension(50, 200));
panel_side.add(panel_buttons, BorderLayout.WEST);
panel_buttons.setLayout(new BorderLayout(0, 0));
JPanel panel = new JPanel();
panel.setBackground(new Color(0, 0, 153));
panel.setPreferredSize(new Dimension(50, 50));
panel_buttons.add(panel, BorderLayout.NORTH);
panel.setLayout(new BorderLayout(0, 0));
JLabel lblNewLabel = new JLabel("");
lblNewLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
panel_side.setVisible(false);
}
});
lblNewLabel.setPreferredSize(new Dimension(50, 50));
lblNewLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
lblNewLabel.setHorizontalTextPosition(SwingConstants.CENTER);
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
ImageIcon imageIcon = new ImageIcon(new ImageIcon("C:\\Users\\Elmar\\Pictures\\exit.png").getImage().getScaledInstance(40, 40, Image.SCALE_DEFAULT));
lblNewLabel.setIcon(imageIcon);
panel.add(lblNewLabel, BorderLayout.CENTER);
JPanel panel_main = new JPanel();
panel_main.setPreferredSize(new Dimension(600, 600));
frame.getContentPane().add(panel_main, BorderLayout.CENTER);
}
}