
怎样隐藏窗口标题栏(java)
3个回答
展开全部
楼主你好
可以用JFrame(或者Frame)类对象的setUndecorated方法来实现
public void setUndecorated(boolean undecorated)
禁用或启用此组件的装饰.
当参数设为true时 就隐藏了窗口标题栏
给lz一个例子:
import javax.swing.*;
public class Test extends JFrame
{
public Test()
{
this.setUndecorated(true);//隐藏标题栏
this.setSize(300,300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main (String[] args) {
new Test();
}
}
希望能帮助你哈
可以用JFrame(或者Frame)类对象的setUndecorated方法来实现
public void setUndecorated(boolean undecorated)
禁用或启用此组件的装饰.
当参数设为true时 就隐藏了窗口标题栏
给lz一个例子:
import javax.swing.*;
public class Test extends JFrame
{
public Test()
{
this.setUndecorated(true);//隐藏标题栏
this.setSize(300,300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main (String[] args) {
new Test();
}
}
希望能帮助你哈

2024-10-22 广告
百事牛是共享提供商,我们提供可靠有效的服务,适当合理的授权费有利于的继续更新优化。同样的事情,同样的方法,百事牛团队十年磨一剑,始终至聚焦在密码恢复领域,深耕于此,我们已研制出有别于其他公司的算法和运算模式, 百事牛的暴力模式加入了分布式点...
点击进入详情页
本回答由百事牛提供
展开全部
用JFrame(Frame)类对象的setUndecorated方法来实现.
组件.setUndecorated(true);
上述这句话就能实现
组件.setUndecorated(true);
上述这句话就能实现
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
借来的代码,你试试:
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Already there
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setUndecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Already there
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setUndecorated(true);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询