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

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

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

JFrame.addWindowStateListener介绍

暂无

代码示例

代码示例来源:origin: Nilhcem/FakeSMTP

mainFrame.addWindowStateListener(windowListener); // used for TrayIcon
mainFrame.setSize(frameSize);
mainFrame.setMinimumSize(frameSize);

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

public static void main(String[] args) {
  final JFrame jf = new JFrame();
  jf.addWindowStateListener(new WindowStateListener() {
    @Override
    public void windowStateChanged(WindowEvent e) {
      System.out.println(e.getNewState());
      if(e.getNewState() == JFrame.ICONIFIED) {
        jf.setExtendedState(JFrame.NORMAL);
      }
    }
  });
  jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  jf.setBounds(100, 100, 300, 300);
  jf.setVisible(true);
}

代码示例来源:origin: com.quinsoft.zeidon/object-browser

protected void startup()
{
  // Create and set up the window.
  mainFrame = new JFrame();
  mainFrame.setTitle( "Zeidon Object Browser" );
  mainFrame.setName( "Object Browser" );
  mainFrame.getContentPane().add( new MainPanel( env ) );
  
  URL iconUrl = Resources.getResource( "tzobrwad.png" );
  ImageIcon image = new ImageIcon( iconUrl );
  mainFrame.setIconImage( image.getImage() );
  BrowserEventHandler listener = new BrowserEventHandler();
  mainFrame.addWindowStateListener( listener );
  mainFrame.addWindowListener( listener );
  mainFrame.pack();
  env.restoreEnvironment();
  // Display the window.
  mainFrame.setVisible( true );
  
  // Use invokeLater otherwise toFront() won't always work.
  java.awt.EventQueue.invokeLater(new Runnable() {
    @Override
    public void run() {
      mainFrame.toFront();
    }
  });
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

appWindow.addWindowStateListener(windowStateListener);
appWindow.addComponentListener(parentListener);

代码示例来源:origin: cpesch/RouteConverter

frame.addWindowStateListener(new WindowStateListener() {
  public void windowStateChanged(WindowEvent e) {
    putPreferencesState();

代码示例来源:origin: com.github.jjYBdx4IL.utils/junit4-utils

jf.removeWindowStateListener(l);
jf.addWindowStateListener(new WindowStateListener() {
  @Override
  public void windowStateChanged(WindowEvent arg0) {

代码示例来源:origin: com.github.jjYBdx4IL/github-test-utils

jf.removeWindowStateListener(l);
jf.addWindowStateListener(new WindowStateListener() {
  @Override
  public void windowStateChanged(WindowEvent arg0) {

相关文章

JFrame类方法