当前位置:网站首页>JFrame needs to be resized before it can be displayed. The setbounds() method in JPanel does not work
JFrame needs to be resized before it can be displayed. The setbounds() method in JPanel does not work
2022-07-21 23:55:00 【A couch potato who doesn't like lying in bed】
JFrame,JPanel Summary of frequently encountered problems
Question 1 : JFrame You need to resize to display the control
Sometimes I'm doing Java When designing the view interface , You will inadvertently find that you need to resize the window to display .
reason :setVisible The position of is not correct .
Solutions :
setVisible(true); It should be placed at the end of the code segment .
Join in
setVisible(false);
setVisible(true);
Forced refresh interface .
Question two : stay JPanel in setBounds() Method doesn't work
reason :JPanel Of setLayout Layout and setBounds Methods conflict
Solutions :
Cancel JPanel Layout
setLayout(null);no need JPanel change to the use of sth. Container Container to load components .
边栏推荐
- [software test model evolution]
- 视图
- Lamp Architecture - MySQL router (read / write separator)
- Frequently asked interview questions in software testing [2]
- "Polite interaction, thank you for your participation" and you will have the opportunity to receive Navicat premium 16
- Zabbix+ distributed database tidb realizes distributed database monitoring
- Special test of APP compatibility
- Centos7 configuring MySQL multiple instances
- On nested connection
- Does Navicat 16 support native Apple silicon M1 chips| Apple user must read
猜你喜欢
随机推荐
Peoplecode operator
快速解决电脑无线网络无法连接问题
JMeter之读响应求头的信息/获取请求头
基础的md5加密
JMeter之JDBC连接/操作数据库
JMeter之聚合报告
Set up form
Use case exercise 1
[tips] quickly pop up the CMD window under the current directory and the path is the current path
win7系统忘记登录密码怎么办?(不用启动盘情况下)
Use Mysql to query logs slowly
charles常用功能
How to write the use case of APP registration function?
LAMP架构——mysql路由器(读写分离器)
Zabbix + Distributed Database tidb Implementation of Distributed Database Monitoring
Test case management tool recommendation
Peoplecode variable
"Polite interaction, thank you for your participation" and you will have the opportunity to receive Navicat premium 16
How to do app upgrade test?
Chessboard coverage problem