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

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

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

JFrame.setExtendedState介绍

暂无

代码示例

代码示例来源:origin: RipMeApp/ripme

@Override
  public void mouseClicked(MouseEvent e) {
    toggleTrayClick();
    if (mainFrame.getExtendedState() != JFrame.NORMAL) {
      mainFrame.setExtendedState(JFrame.NORMAL);
    }
    mainFrame.setAlwaysOnTop(true);
    mainFrame.setAlwaysOnTop(false);
  }
});

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

JFrame frame = new JFrame();
//...
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

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

@Override
  public void actionPerformed(ActionEvent ae) {
    int state = frame.getExtendedState();
    state &= ~Frame.ICONIFIED;
    frame.setExtendedState(state);
    frame.setVisible(true);
    tray.remove(trayIcon);
    trayIcon.removeActionListener(this);
  }
});

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

public static void main(String[] args)  {

  JFrame frame = new JFrame();
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setVisible(true);
}

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

public class TEST
{
  public static void main(String args[])
  {
    JFrame jf= new JFrame();
    jf.setVisible(true);
    jf.setExtendedState(JFrame.MAXIMIZED_BOTH);
    }
}

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

JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
// Dimension windowSize = frame.getContentPane().getSize();
// System.out.println(windowSize);
frame.setVisible(true);

Dimension windowSize = frame.getContentPane().getSize();
System.out.println(windowSize);

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

super(app);
 JFrame frame = new JFrame();
 frame.pack();
 frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
 frame.setResizable(false);
 this.setFrame(frame);
 initComponents();

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

public static void main(String[] args) {
  SwingUtilities.invokeLater( () -> {
    JFrame frame = new JFrame();
    frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    frame.setVisible(true);             // <<-- Window becomes visible here
    pixel = new Pixel(1600, 900);
    frame.getContentPane().add(pixel);  // <<-- Safe - running on EDT.
    pixel.testChange();  // <<-- Also safe - running on EDT
  });
}

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

public static void main(String[] args) {
  JFrame frame = new JFrame();
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setVisible(true);             // <<-- Window becomes visible here
  pixel = new Pixel(1600, 900);
  frame.getContentPane().add(pixel);  // <<-- DANGEROUS!!
}

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

public static void main(String[] args) {
  JFrame frame = new JFrame();
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  pixel = new Pixel(1600, 900);
  frame.getContentPane().add(pixel);  // <<-- Safe - window not visible yet.
  frame.setVisible(true);             // <<-- Window becomes visible here
}

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

public static void main(String[] args) {

  Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

  JFrame frame = new JFrame("Jedia");
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setSize(screenSize);
  frame.setVisible(true);    // FIRST visible = true
  frame.setResizable(false); // THEN  resizable = false
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

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

/**
 * Minimize the provided frame.
 *
 * @param frame the frame to minimize to icon
 * @see #unMinimize(JFrame)
 */
public static void minimize (JFrame frame)
{
  int state = frame.getExtendedState();
  state &= ICONIFIED;
  frame.setExtendedState(state);
}

代码示例来源:origin: it.tidalwave.blueshades/it-tidalwave-blueshades-profileevaluation-ui-netbeans

/*******************************************************************************************************************
 * 
 *
 ******************************************************************************************************************/
public NetBeansProfileEvaluationSequencePresentation()
 {
  assert EventQueue.isDispatchThread();
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setUndecorated(true); 
  frame.add(panel);
 }

代码示例来源:origin: it.tidalwave.blueargyle/it-tidalwave-uniformity-ui-netbeans

/*******************************************************************************************************************
 * 
 *
 ******************************************************************************************************************/
public NetBeansUniformityCheckMeasurementPresentation()
 {
  assert EventQueue.isDispatchThread();
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setUndecorated(true); 
  frame.add(panel);
 }

代码示例来源:origin: chungkwong/MathOCR

public static void main(String[] args) throws IOException{
  JFrame f=new JFrame();
  SceneTextDetector detector=new SceneTextDetector();
  f.add(detector);
  f.setExtendedState(JFrame.MAXIMIZED_BOTH);
  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  f.setVisible(true);
  detector.setDividerLocation(500);
}
@Override

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
  public void actionPerformed(ActionEvent evt) {
    JFrame frame = getFrame();
    if (frame != null) {
      frame.setExtendedState(frame.getExtendedState() ^ Frame.MAXIMIZED_BOTH);
    } else {
      Toolkit.getDefaultToolkit().beep();
    }
  }
}

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

@Override
  public void run(MouseEvent me) {
    Lancador.getInstance().getJFrame().setExtendedState(JFrame.ICONIFIED);
  }
});

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

JFrame frame = ...;
frame.setExtendedState(JFrame.NORMAL);
frame.setAlwaysOnTop(true);
frame.requestFocus();
frame.setAlwaysOnTop(false);

代码示例来源:origin: com.googlecode.princeton-java-introduction/stdlib

public static void fullscreen () {
  frame.setResizable(true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
  int w = frame.getSize().width;
  int h = frame.getSize().height;
  //int w = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth();
  //int h = (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight();
  int borderY = frame.getInsets().top + frame.getInsets().bottom;
  int borderX = frame.getInsets().left + frame.getInsets().right;
  setCanvasSize(w - borderX, h - borderY - menuBar.getHeight(), true);
  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
}

代码示例来源:origin: otros-systems/otroslogviewer

public static void frameToFront(JFrame frame) {
 int state = frame.getExtendedState();
 state &= ~JFrame.ICONIFIED;
 frame.setExtendedState(state);
 frame.setAlwaysOnTop(true);
 frame.toFront();
 frame.requestFocus();
 frame.setAlwaysOnTop(false);
}

相关文章

JFrame类方法