Αποτελέσματα Αναζήτησης
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 · Controls whether the user can resize the JFrame. setIconImage(Image image) Sets the icon (image) for the JFrame window.
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();
6 Ιουλ 2019 · JFrame is a Swing’s top-level container that renders a window on screen. A frame is a base window on which other components rely, such as menu bar, panels, labels, text fields, buttons, etc. Almost every Swing application starts with JFrame window. This article provides a summary of common practices when using JFrame in Swing development. 1.
6 Αυγ 2022 · So, here's a sample Java Swing method that demonstrates how to make a given JFrame fill the full size of the current screen: private void makeFrameFullSize(JFrame aFrame) {. Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); aFrame.setSize(screenSize.width, screenSize.height); }
import java.awt.GraphicsEnvironment; import javax.swing.JFrame; public class Main extends JFrame { public Main() { GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH); } public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated ...