当前位置:网站首页>Swing component
Swing component
2022-07-25 10:16:00 【Look at the bugs】
Popup
package Swing;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static javax.swing.WindowConstants.EXIT_ON_CLOSE;
public class Dialog01 extends JFrame {
public static void main(String[] args) {
new Dialog01();
}
public Dialog01() {
this.setVisible(true);
this.setBounds(100, 100, 200, 200);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
Container container = this.getContentPane();
// Absolute layout
container.setLayout(null);
// Button
JButton button = new JButton(" Click to pop up a dialog box ");// establish
button.setBounds(100, 100, 500, 500);
// A pop-up window pops up when you click the button
button.addActionListener(new ActionListener() {
// Monitor
@Override
public void actionPerformed(ActionEvent e) {
new MyDialog();
}
});
container.add(button);
}
}
// Pop up window
class MyDialog extends JDialog{
public MyDialog() {
this.setBounds(100,100,100,100);
// this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
Container container =new Container();
container.setLayout(null);
container.add(new Label(" Tomorrow's scenery is more beautiful "));
this.add(container);
this.setVisible(true);
}
}
边栏推荐
猜你喜欢
![[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)](/img/6e/da80133e05b18c87d7167c023b6c93.gif)
[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)

力扣刷题组合问题总结(回溯)

Redis使用场景

canal实现mysql数据同步

UE4 LoadingScreen动态加载启动动画

nodejs版本升级或切换的常用方式

nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE

Debug篇快捷键入门

数论--约数研究

@Import,Conditional和@ImportResourse注解
随机推荐
1、 Initial mysql, MySQL installation, environment configuration, initialization
shortest-unsorted-continuous-subarray
Selenium 等待元素出现与等待操作可以执行的条件
TensorFlow raw_ RNN - implement the seq2seq mode to take the output of the previous time as the input of the next time
文件的上传功能
UE4源码的获取和编译
nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE
File upload function
CCF 201503-3 Festival
简易加法计算器
多线程——死锁和synchronized
vscode插件开发
[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)
SSM整合(简单的图书管理系统来整合SSM)
JDBC操作数据库详解
Usage of string slicing
动态规划,购物单问题
yarn速查手册
用户喜好
UE4 窗口控制(最大化 最小化)