Guten Morgen
Wie bekomme ich in Bild in den Hintergrund???:L
Sollte eigentlich einfach sein, aber mit allem was ich bisher ausprobiert hab werden die anderen Komponenten gestört. Bitte um Hilfe
Wie bekomme ich in Bild in den Hintergrund???:L
Sollte eigentlich einfach sein, aber mit allem was ich bisher ausprobiert hab werden die anderen Komponenten gestört. Bitte um Hilfe
Java:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FullScreenJFrame extends JFrame implements KeyListener
{
private static final long serialVersionUID = 1L;
static Thread Th;
public FullScreenJFrame(String title)
{
super(title);
setUndecorated(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(0, 0, screenSize.width, screenSize.height);
//*addKeyListener(this);
addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
{
FullScreenJFrame.this.setVisible(false);
System.exit(0);
}
}
}
);
}//End of method FullScreenJFrame
public FullScreenJFrame()
{
super("Nachrichtentransfer");
}
public static void main(String[] args)
{
Runnable gui = new Runnable()
{
public void run()
{try {
Thread.sleep(10);
FullScreenJFrame frame = new FullScreenJFrame("Elemente");
frame.setLayout(null);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
Thread.sleep(10);
Plasma plasma = new Plasma();
plasma.init();
plasma.start();
plasma.setFocusable(false);
plasma.setBounds(0 , 0 ,400, 400);
frame.add(plasma);
Thread.sleep(10);
/*
deko2 w2 = new deko2();
w2.init();
w2.start();
w2.setFocusable(false);
w2.setBounds(0, 0, 100, 100);
frame.add(w2);
Thread.sleep(10);
*/
Wirk w = new Wirk();
w.init();
w.start();
w.setFocusable(false);
w.setBounds(0, 0, 85, 20);
frame.add(w);
Thread.sleep(10);
eta et = new eta();
et.init();
et.start();
et.setFocusable(false);
et.setBounds(0 , 0 ,500, 350);
frame.add(et);
Thread.sleep(10);
temp2 tm = new temp2();
tm.init();
tm.start();
tm.setFocusable(false);
tm.setBounds(0 ,0 ,50, 400);
frame.add(tm);
Thread.sleep(10);
sli11 slider1 = new sli11();
slider1.init();
slider1.start();
slider1.setFocusable(false);
slider1.setBounds(0, 0, 220, 900);
frame.add(slider1);
Thread.sleep(10);
sli22 slider2 = new sli22();
slider2.init();
slider2.start();
slider2.setFocusable(false);
slider2.setBounds(0, 0, 220, 900);
frame.add(slider2);
Thread.sleep(10);
sli3 slider3 = new sli3();
slider3.init();
slider3.start();
slider3.setFocusable(false);
slider3.setBounds(0, 0, 520, 432);
frame.add(slider3);
Thread.sleep(10);
etax ex = new etax();
ex.init();
ex.start();
ex.setFocusable(false);
ex.setBounds(0 , 0 ,510, 60);
frame.add(ex);
Thread.sleep(10);
etay ey = new etay();
ey.init();
ey.start();
ey.setFocusable(false);
ey.setBounds(0 , 50 ,180, 450);
frame.add(ey);
Thread.sleep(10);
minmax label = new minmax();
label.init();
label.start();
label.setFocusable(false);
label.setBounds(0, 0, 60, 400);
frame.add(label);
Thread.sleep(10);
legendT lt = new legendT();
lt.init();
lt.start();
lt.setFocusable(false);
lt.setBounds(0, 0, 220, 20);
frame.add(lt);
Thread.sleep(10);
/*
Button1 btn1 = new Button1();
btn1.init();
btn1.start();
btn1.setFocusable(true);
btn1.setBounds(0, 0, 180, 35);
frame.add(btn1);
Thread.sleep(10);
*/
Button2 btn2 = new Button2();
btn2.init();
btn2.start();
btn2.setFocusable(false);
btn2.setBounds(0, 0, 180, 35);
frame.add(btn2);
Thread.sleep(10);
Button3 btn3 = new Button3();
btn3.init();
btn3.start();
btn3.setFocusable(false);
btn3.setBounds(0, 0, 180, 35);
frame.add(btn3);
Thread.sleep(10);
Button4 btn4 = new Button4();
btn4.init();
btn4.start();
btn4.setFocusable(false);
btn4.setBounds(0, 0, 180, 35);
frame.add(btn4);
Thread.sleep(10);
legendEta lE = new legendEta();
lE.init();
lE.start();
lE.setFocusable(false);
lE.setBounds(0, 0, 320, 20);
frame.add(lE);
Thread.sleep(10);
Zeit t = new Zeit();
t.init();
t.start();
t.setFocusable(false);
t.setBounds(0, 0, 80, 20);
frame.add(t);
Thread.sleep(10);
LED led = new LED();
led.init();
led.start();
led.setFocusable(false);
led.setBounds(0, 0, 1280, 1024);
frame.add(led);
Thread.sleep(10);
frame.setVisible(true);
} catch (InterruptedException e)
{
//e.printStackTrace();
}
}
};
//GUI must start on EventDispatchThread:
SwingUtilities.invokeLater(gui);
}
public void paint(Graphics g)
{
g.setFont(new Font("Serif", Font.PLAIN, 18));
g.drawString("Zum Beenden bitte ESC drücken...", 50, 50);
}
public void stop()
{}
public void destroy()
{}
public void keyPressed(KeyEvent arg0)
{}
public void keyReleased(KeyEvent arg0)
{}
public void keyTyped(KeyEvent arg0)
{}
}//End of class FullScreenJFrame