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

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

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

JFrame.setEnabled介绍

暂无

代码示例

代码示例来源:origin: SINTEF-9012/JArduino

public void disable() {
  frame.setEnabled(false);
}

代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces

@Override
  public void actionPerformed(ActionEvent arg0)
  {
   frame.dispose();
   frame.setEnabled(false);
  }
});

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

@Override
  public void actionPerformed(ActionEvent arg0)
  {
   frame.dispose();
   frame.setEnabled(false);
  }
});

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

@Override
  public void actionPerformed(ActionEvent arg0)
  {
   frame.dispose();
   frame.setEnabled(false);
  }
});

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

public static void main(String[] args) {
  final JFrame frame = new JFrame();

  JButton button = new JButton("hello");
  button.addActionListener(e -> {
    frame.setEnabled(false); // disable main frame
    JOptionPane.showMessageDialog(frame, "hello");
    frame.setEnabled(true); // enable main frame
  });
  frame.setContentPane(button);

  frame.setVisible(true);
  frame.setSize(600, 480);
  frame.setLocationRelativeTo(null);
  frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}

代码示例来源:origin: SINTEF-9012/JArduino

public void enable(){
  frame.setEnabled(true);
  frame.toFront();
}

代码示例来源:origin: com.b3dgs.lionengine/lionengine-core-awt

@Override
public void start()
{
  super.start();
  frame.validate();
  frame.setEnabled(true);
  frame.setVisible(true);
}

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

JFrame mainWindow = new JFrame;
mainWindow.setVisible(true);
JFrame modalWindow = new JFrame();
// The next two sentences gives modalWindow modal beahaviour
mainWindow.setEnabled(false);
mainWindow.setFocusable(false);
modalWindow.setVisible(true);

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

private void formWindowClosing(java.awt.event.WindowEvent evt) {
  frame.setTitle("Closing...");
  frame.setEnabled(false);
  try {
    log.info("cancelProgress...");
    cancelProgress();
  } catch (InterruptedException ex) {
    log.warn("Exception", ex);
  }
  if (toDatabase != null) {
    try {
      log.trace("toDatabase.abort()...");
      toDatabase.abort();
    } catch (InterruptedException ex) {
      log.warn("Exception", ex);
    }
  }
}

代码示例来源:origin: jmtd/wadc

public static void main(String [] args) {
    WadCPrefs prefs = new WadCPrefs();
    final JFrame frame = new JFrame();
    final EngineConfigDialog ecd = new EngineConfigDialog(frame, prefs);

    prefs.addPreferenceChangeListener(ecd);

    frame.setEnabled(true);
    frame.pack();
    frame.setVisible(true);
    ecd.pack();
    ecd.setVisible(true);
  }
}

相关文章

JFrame类方法