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

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

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

JDialog.setCursor介绍

暂无

代码示例

代码示例来源:origin: org.fudaa.framework.ebli/ebli-common

void startComputing() {
 if (owner_ != null) {
  stop_ = new BuGlassPaneStop();
  if (owner_ != null) {
   owner_.setGlassPane(stop_);
   stop_.setVisible(true);
   owner_.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  }
 }
}

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  JFrame parent = new JFrame();
  parent.setSize(400, 400);
  parent.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  parent.setVisible(true);

  Object[] possibilities = { "ham", "spam", "yam" };

  // raw pane
  JOptionPane optionPane = new JOptionPane(
      "Complete the sentence:\n\"Green eggs and...\"",
      JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null,
      possibilities, possibilities[0]);

  // create a dialog for it with the title
  JDialog dialog = optionPane.createDialog("Customized Dialog");

  // special code - in this case make the cursors match
  dialog.setCursor(parent.getCursor());

  // show it
  dialog.setVisible(true);

  // blocking call, gets the selection
  String s = (String) optionPane.getValue();

  System.out.println("Selected " + s);
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

private void initGUI() {
  JLabel label = new JLabel(this.message, SwingConstants.CENTER);
  JButton cancelButton = new JButton("Cancel");
  cancelButton.addActionListener(new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
      WaitDialog.this.dialog.hide();
      WaitDialog.this.cancelable.cancel();
    }
  });
  JPanel buttonPanel = new JPanel();
  buttonPanel.add(cancelButton);
  this.dialog = new XBayaDialog(this.xbayaGUI, this.title, label, buttonPanel);
  this.dialog.getDialog().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
  this.dialog.getDialog().setCursor(SwingUtil.WAIT_CURSOR);
  this.dialog.getDialog().addComponentListener(new ComponentAdapter() {
    @Override
    public void componentShown(ComponentEvent e) {
      shown();
    }
  });
}

代码示例来源:origin: org.fudaa.framework.ebli/ebli-common

void stopComputing() {
 if (stop_ != null) {
  stop_.setVisible(false);
  if (owner_ != null) {
   owner_.getRootPane().remove(stop_);
  }
 }
 owner_.setCursor(Cursor.getDefaultCursor());
}

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

dialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
disableDialogComponents();
final File selectedFile = fileChooser.getSelectedFile();

代码示例来源:origin: MegaMek/megamek

/**
 * Saves the board in PNG image format.
 */
private void boardSaveImage(boolean ignoreUnits) {
  if (curfileBoardImage == null) {
    boardSaveAsImage(ignoreUnits);
    return;
  }
  JDialog waitD = new JDialog(frame, Messages
      .getString("BoardEditor.waitDialog.title")); //$NON-NLS-1$
  waitD.add(new JLabel(Messages
      .getString("BoardEditor.waitDialog.message"))); //$NON-NLS-1$
  waitD.setSize(250, 130);
  // move to middle of screen
  waitD.setLocation(
      (frame.getSize().width / 2) - (waitD.getSize().width / 2), (frame
      .getSize().height
      / 2) - (waitD.getSize().height / 2));
  waitD.setVisible(true);
  frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  // save!
  try {
    ImageIO.write(bv.getEntireBoardImage(ignoreUnits), "png", curfileBoardImage);
  } catch (IOException e) {
    e.printStackTrace();
  }
  waitD.setVisible(false);
  frame.setCursor(Cursor.getDefaultCursor());
}

代码示例来源:origin: MegaMek/megamek

waitD.setVisible(true);
frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

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

final int[] rowToWrite = row;
parentDial_.setGlassPane(s);
parentDial_.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
s.setVisible(true);
final CtuluTaskDelegate task = ui_.createTask(CtuluLib.getS("Export format texte"));

相关文章

JDialog类方法