Grundlegende Java Projekt Strukturen angelegt.
This commit is contained in:
6
.classpath
Normal file
6
.classpath
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/bin/
|
17
.project
Normal file
17
.project
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>inb1-a-jaujau</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
2
.settings/org.eclipse.ltk.core.refactoring.prefs
Normal file
2
.settings/org.eclipse.ltk.core.refactoring.prefs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
118
src/jaujau/JauJauGUI.java
Normal file
118
src/jaujau/JauJauGUI.java
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user