2016-12-21 8 views
1

スイング(JFrame)を使用してcsgoのオーバーレイを作成しようとしています 私が必要とするすべてを達成しましたが、修正できない小さなバグが1つあります。私はどこでそれを修正する方法を見てきましたが、私はそれを理解できません!JavaスイングオーバーレイのJFrameを無効にする

レンダリングされているものの上にマウスを置くたびに、マウスに「フォーカス」を与え、ゲームから私を外します!

package com.rigadrinksbleach.csgo.external.overlay; 
import java.awt.Color; 
import java.awt.Graphics; 
import javax.swing.JFrame; 

import com.rigadrinksbleach.csgo.external.Start; 
import com.rigadrinksbleach.csgo.external.hack.Hack; 

public class ExternalOverlay extends JFrame { 

public ExternalOverlay() { 
    super("Overlay"); 
    this.setUndecorated(true); 
    this.setBackground(new Color(0, 0, 0, 0)); 
    this.setBounds(0, 0, 1920, 1080); 
    this.setAlwaysOnTop(true); 
    this.getContentPane().setLayout(new java.awt.FlowLayout()); 
    this.setVisible(true); 
} 

public void loop() { 
    this.repaint(); 
} 

public void draw(Graphics g) { 
    for(Hack hack : Start.getHacks().getHacks()) { 
     hack.draw2d(g); 
    } 
} 

@Override 
public void paint(Graphics g) { 
    super.paint(g); 
    //g.setColor(new Color(255, 0, 0)); 
    //g.drawRect(0, 0, this.getBounds().width - 1 - this.getBounds().x, this.getBounds().height - 1 - this.getBounds().y); //debug border 
    this.draw(g); 
} 

} 

Gif of the problem 任意の助けいただければ幸いです。

+0

'frame.setFocusable(false);' – XtremeBaumer

+0

これはうまくいかない:/ – 420Blaze

答えて

-1

私はこれに関する修正を知っています。 setVisibleをFalseに変更するだけです。

関連する問題