javax.swing.JFrame.setCursor()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(843)

本文整理了Java中javax.swing.JFrame.setCursor()方法的一些代码示例,展示了JFrame.setCursor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.setCursor()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:setCursor

JFrame.setCursor介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

private void showCursor (boolean visible) {
  if (!visible) {
    Toolkit t = Toolkit.getDefaultToolkit();
    Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
    Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
    JFrame frame = findJFrame(canvas);
    frame.setCursor(noCursor);
  } else {
    JFrame frame = findJFrame(canvas);
    frame.setCursor(Cursor.getDefaultCursor());
  }
}

代码示例来源:origin: libgdx/libgdx

private void showCursor (boolean visible) {
  if (!visible) {
    Toolkit t = Toolkit.getDefaultToolkit();
    Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
    Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
    JFrame frame = findJFrame(canvas);
    frame.setCursor(noCursor);
  } else {
    JFrame frame = findJFrame(canvas);
    frame.setCursor(Cursor.getDefaultCursor());
  }
}

代码示例来源:origin: SonarSource/sonarqube

@Override
public void valueChanged(TreeSelectionEvent e) {
 DefaultMutableTreeNode node = (DefaultMutableTreeNode) componentTree.getLastSelectedPathComponent();
 if (node == null) {
  // Nothing is selected.
  return;
 }
 frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
 updateDetails((Component) node.getUserObject());
 frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void actionPerformed(ActionEvent e) {
  if ("Start".equals(e.getActionCommand())) {
    frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    trayIcon.setImage(offIcon.getImage());
    frame.setCursor(Cursor.getDefaultCursor());
    browserButton.setEnabled(false);
    startButton.setEnabled(true);

代码示例来源:origin: Audiveris/audiveris

@Override
  public void run ()
  {
    frame.setCursor(busyCursor);
  }
};

代码示例来源:origin: sc.fiji/TrakEM2_

static public void setCursorToAll(final Cursor c) {
  for (final Display d : al_displays) {
    if (null != d.frame) d.frame.setCursor(c);
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * {@inheritDoc}
 */
@Override
public void setCursor(Cursor c) {
  if (!isWaitCursorVisible()) {
    super.setCursor(c);
  } else {
    this.realCursor = c;
  }
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

/**
 * {@inheritDoc}
 */
@Override
public void setCursor(Cursor c) {
  if (!isWaitCursorVisible()) {
    super.setCursor(c);
  } else {
    this.realCursor = c;
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

/**
 * {@inheritDoc}
 */
@Override
public void setCursor(Cursor c) {
  if (!isWaitCursorVisible()) {
    super.setCursor(c);
  } else {
    this.realCursor = c;
  }
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

/**
 * {@inheritDoc}
 */
@Override
public void setCursor(Cursor c) {
  if (!isWaitCursorVisible()) {
    super.setCursor(c);
  } else {
    this.realCursor = c;
  }
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

/**
 * {@inheritDoc}
 */
@Override
public void setCursor(Cursor c) {
  if (!isWaitCursorVisible()) {
    super.setCursor(c);
  } else {
    this.realCursor = c;
  }
}

代码示例来源:origin: com.harium.propan/propan-jogl

public void hideDefaultCursor() {
  
  int[] pixels = new int[16 * 16];
  
  Cursor transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor(
      Toolkit.getDefaultToolkit().createImage( new MemoryImageSource(16, 16, pixels, 0, 16))
      , new Point(0, 0), "invisibleCursor");
  component.setCursor( transparentCursor );
}

代码示例来源:origin: org.sonarsource.sonarqube/sonar-scanner-protocol

@Override
public void valueChanged(TreeSelectionEvent e) {
 DefaultMutableTreeNode node = (DefaultMutableTreeNode) componentTree.getLastSelectedPathComponent();
 if (node == null) {
  // Nothing is selected.
  return;
 }
 frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
 updateDetails((Component) node.getUserObject());
 frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public static void main(String[] argv)
 {
  JFrame frame=new JFrame("test curseur");
  frame.setBounds(0,0,200,200);
  frame.setVisible(true);
  //BuPreferences.BU.put("cursors.size","26");
  //BuPreferences.BU.put("cursors.monochrome","true");
  frame.setCursor(BU.getCursor("voir",10,10));
 }
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

private void showCursor (boolean visible) {
  if (!visible) {
    Toolkit t = Toolkit.getDefaultToolkit();
    Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
    Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
    JFrame frame = findJFrame(canvas);
    frame.setCursor(noCursor);
  } else {
    JFrame frame = findJFrame(canvas);
    frame.setCursor(Cursor.getDefaultCursor());
  }
}

代码示例来源:origin: org.icepdf.os/icepdf-viewer

private void setCursorOnComponents(final int cursorType) {
    Cursor cursor = documentViewController.getViewCursor(cursorType);
    if (utilityTabbedPane != null)
      utilityTabbedPane.setCursor(cursor);
//        if( documentViewController != null ) {
//            documentViewController.setViewCursor( cursorType );
//        }
    if (viewer != null)
      viewer.setCursor(cursor);
  }

代码示例来源:origin: net.imagej/ij

public void mouseDragged(MouseEvent e)
  {
    int selRow = pTree.getRowForLocation(e.getX(), e.getY());
    if(selRow!=-1)
    {
      if(((DefaultMutableTreeNode)pTree.getLastSelectedPathComponent()).isLeaf()) return;
      pFrame.setCursor(new Cursor(Cursor.MOVE_CURSOR));
      isDragging = true;
    }
  }
});

代码示例来源:origin: imagej/ImageJA

public void mouseDragged(MouseEvent e)
  {
    int selRow = pTree.getRowForLocation(e.getX(), e.getY());
    if(selRow!=-1)
    {
      if(((DefaultMutableTreeNode)pTree.getLastSelectedPathComponent()).isLeaf()) return;
      pFrame.setCursor(new Cursor(Cursor.MOVE_CURSOR));
      isDragging = true;
    }
  }
});

代码示例来源:origin: hltfbk/Excitement-Open-Platform

public void run() {
    try {
      // cpe.getButtonGo().setText(CustomProofEngine.BUTTON_GO_TEXT);
      cpe.enableAll();
      cpe.getMainFrame().setCursor(null);
      cpe.setStatusBarSystemState(VisualTracingTool.READY_STATUS_BAR_SYSTEM_STATE);
      cpe.updateStatusBarLabel();
    } catch (Exception ex) {
      handleError(ex, false);
    }
  }
});

代码示例来源:origin: sc.fiji/TrakEM2_

Utils.invokeLater(new Runnable() { public void run() {
    if (null != IJ.getInstance()) IJ.getInstance().setCursor(c);
    ini.trakem2.display.Display.setCursorToAll(c);
    if (null != frame && frame.isVisible()) frame.setCursor(c); // the ControlWindow frame
  }});
}

相关文章

JFrame类方法