我正在尝试设置YouCompleteMe,一个vim的代码完成插件.当我运行vim时,它给了我这个错误消息:"YouCompleteMe不可用:需要python 2.x".我在我的ubuntu机器上安装了正确版本的python,这让我很困惑.经过一些研究,我发现我需要在vim中支持python2 ,而不仅仅是在我的系统上(https://github.com/Valloric/YouCompleteMe/issues/35).我怎样才能做到这一点?我无法在任何地方找到类似的答案.
在此先感谢您的帮助!
我正在设计一个使用Java swing框架的基于网格的游戏.我有一个带有两个JPanel的JFrame,但其中一个出现在两个地方.这是一个截图:

显示"转1"并具有按钮的面板应该只显示在网格的右侧,但奇怪的是它也出现在左上角.这是我的代码:
public class ArenaPanel extends JPanel {
private final GridPanel gp;
private final InfoPanel ip;
private GameManager gm;
private int w, h;
private int cw, ch;
private double tw, th;
private Point p2;
private Point p1;
private int shotWidth;
private Color shotColor;
public ArenaPanel(int w, int h) {
Images.load();
setLayout(new GridBagLayout());
this.w = w;
this.h = h;
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 1;
c.weightx = 0;
c.weighty = 1;
gp = new GridPanel(); …Run Code Online (Sandbox Code Playgroud)