Schlagwort-Archiv: java

Full Screen Black


Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 1997

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 2009

Warning: Illegal string offset 'status_txt' in /www/htdocs/w00cea89/woppr/wp-content/plugins/share-and-follow/share-and-follow.php on line 2036

Das Javaprogramm “ Full Screen Black“ erzeugt einen schwarzen Bildschirm im Vollbildmodus. Durch Doppelklicken der „FullScreenBlack_v1.0.jar“-Datei kann es ausgeführt werden, vorrausgesetzt eine JRE ist installiert.

Das Programm kann hier heruntergeladen werden:
FullScreenBlack_v1.0 (executable .jar file)

Funktion (“ Full Screen Black“ ):
Das Programm erzeugt einen JFrame in der Größe der akuellen Bilschirmauflösung. Der Frame wird in den Vordergrund gesetzt. Durch Drücken der Esc-Taste kann das Programm wieder beendet werden.

Javacode des Programms:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.awt.Color;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JFrame;
 
public class BlackScreen {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		//Set JFrame size to full screen size follow current screen size
		frame.setSize(Toolkit.getDefaultToolkit().getScreenSize().width,Toolkit.getDefaultToolkit().getScreenSize().height);
		frame.getContentPane().setBackground(Color.BLACK);
		frame.setUndecorated(true);
		frame.setAlwaysOnTop(true);
 
		KeyListener kl=new KeyAdapter(){
		  public void keyPressed(KeyEvent evt){
		   //If someone click Esc key, this program will exit
			  if(evt.getKeyCode()==KeyEvent.VK_ESCAPE){
				  System.exit(0);
			  }
		  }
		};
		//add Key Listener to JFrame
		frame.addKeyListener(kl);		
		frame.setVisible(true);
	}
}