Alwaysontop

Solo disponible en BuenasTareas
  • Páginas : 2 (306 palabras )
  • Descarga(s) : 4
  • Publicado : 27 de abril de 2010
Leer documento completo
Vista previa del texto
import java.awt.Component;
import java.awt.Event;
import java.awt.Image;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.PointerInfo;
import java.awt.event.KeyEvent;
importjava.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
importjava.io.IOException;
import java.net.InetAddress;
import java.net.Socket;

import javax.swing.*;
public class Aot {

public static void main(String[] args) throws IOException {

JFrame w = new JFrame();w.setLayout(null);
w.setSize(1280, 980);
Aot ekis = new Aot();

ImageIcon icon = new ImageIcon(ekis.bla());
JLabel eti = new JLabel(icon);
eti.setBounds(0,0,500,500);w.add(eti);
eti.setVisible(true);
//w.setAlwaysOnTop(true);
w.setVisible(true);
KeyListener l = null;
w.addKeyListener(new KeyListener(){

public void keyPressed(KeyEvent e) {// TODO Auto-generated method stub
System.out.println(e.getKeyCode());
JFrame v = new JFrame();
v.setSize(1024, 980);
v.setVisible(false);
if(e.getKeyCode() ==524){
JOptionPane.showMessageDialog(null,"ekiscosa");
v.setVisible(true);
v.setAlwaysOnTop(true);
}
}

public void keyReleased(KeyEvent e) {
// TODOAuto-generated method stub

}

public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub

}

});
w.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);w.setResizable(false);
w.addWindowListener(new WindowAdapter(){
public void windowOpened(WindowEvent e){
System.out.println("bah");
}
});
w.addMouseListener(new MouseListener(){public void mouseExited(MouseEvent e){
//System.out.println("bah "+MouseInfo.getPointerInfo());
/*PointerInfo pointerInfo = MouseInfo.getPointerInfo();
Point point =...
tracking img