Αποτελέσματα Αναζήτησης
6 Δεκ 2013 · Instead, you should create an instance of JFrame and add your components to it, for example... package main; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Panel; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing ...
17 Νοε 2023 · JFrame in Java is a class that allows you to crеatе and manage a top-lеvеl window in a Java application. It sеrvеs as thе main window for GUI-basеd Java applications and providеs a platform-indеpеndеnt way to crеatе graphical usеr intеrfacеs. In Java JFrame is a part of javax.swing package.
Here's an example of how a simple frame works using JFrame. Import JFrame from javax.swing. Create an instance of it, show it, size it, change its title. >>> from javax.swing import JFrame. >>> frame = JFrame() >>> frame.show() >>> frame.size = 200,200. Set the title to " Hello JFC ". >>> frame.title = "Hello JFC" Setting the Frame's Mouse Cursor.
The following are 4 code examples of javax.swing.JFrame(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Python JFrame - 60 examples found. These are the top rated real world Python examples of javax.swing.JFrame extracted from open source projects. You can rate examples to help us improve the quality of examples.
17 Φεβ 2022 · Java. import javax.swing.*; public class test1. { JFrame frame; test1() { frame=new JFrame("first way"); JButton button = new JButton("let's see"); button.setBounds(200, 150, 90, 50); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(button); frame.setSize(500, 600); frame.setLayout(null); frame.setVisible(true); }
27 Απρ 2022 · We create a JFrame object using the new operator and pass the constructor our title. We then set the width is 300 and the height is 200 pixels using the setSize method. Finally, we use the setVisible method to display the frame.