Cannot make a static reference to the non-static method start() from the type Thread
Código PHP:
private JFrame getVentana() {
if (ventana == null) {
ventana = new JFrame();
ventana.setSize(new Dimension(242, 216));
ventana.setTitle("QuicktoBless");
ventana.setContentPane(getCont());
ventana.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent e) {
if(e.getKeyCode()==112+getKeys().getSelectedIndex()){
if(getRun().getText()=="Stoped"){
getRun().setText("Running");
hacerPoder.start();// aki dice: Cannot make a static reference to the non-static method start() from the type Thread
}
else if(getRun().getText()=="Running"){
}
}
}
});
}
return ventana;
}
aki pongo el del thread
Código PHP:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
public class hacerPoder extends Thread{
public void run(){
try {
Robot atk = new Robot();
atk.mousePress(InputEvent.BUTTON3_MASK);
atk.mouseRelease(InputEvent.BUTTON3_MASK);
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Gracias de antemano... eos de los threads como ke no es para mi xD