Αποτελέσματα Αναζήτησης
26 Ιαν 2009 · The way to set JFrame to full-screen, is to set MAXIMIZED_BOTH option which stands for MAXIMIZED_VERT | MAXIMIZED_HORIZ, which respectively set the frame to maximize vertically and horizontally
10 Μαρ 2011 · For an immediate maximise of your form just add this in the JFrame constructor after the InitiateComponents() call. this.setExtendedState(JFrame.MAXIMIZED_BOTH); The class extends JFrame of course: public class MyForm extends javax.swing.JFrame
17 Νοε 2023 · In Java JFrame is a part of javax.swing package. In this article, we will learn about Java JFrame. Constructor of Java JFrame. Methods of Java JFrame. Parent Classes of JFrame Methods. Java JFrame is the part of Java Swing and the classes from where all the methods associated with JFrame are inherited are mentioned below: java.awt.Frame.
10 Μαρ 2018 · How to maximize (or minimize) a JFrame. As a quick note today, here’s some code that shows how to maximize a JFrame: MyJFrame myFrame = new MyJFrame(); // do other stuff here ... // this maximizes the jframe. myFrame.setState(Frame.NORMAL); // do whatever else you want to do ... myFrame.setVisible();
5 Σεπ 2024 · In this article, we will explore how to automatically maximize a JFrame when it is dragged to the top of the screen in Java. We will use the Swing library and the DragGestureRecognizer component to implement this functionality.
To create a JFrame that opens maximized in Java, you can set the default close operation, use the Toolkit class to get the screen size, and apply it to your JFrame. Below are the steps to do this along with a complete example code.
To maximize a JFrame window, you can use the setExtendedState method and pass in the JFrame.MAXIMIZED_BOTH constant as the argument. Maximize Jframe. For example: JFrame frame = new JFrame(); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true);