将标题设置为 JFrame [英] set title to JFrame

查看:32
本文介绍了将标题设置为 JFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Java 新手.我的问题是我有一个类名 MyClassExp.我已经从 JFrame 扩展了它.在该类中,我启动了另一个名为 TabbedFrame 的类的对象.TabbedFrame 还扩展了一个类 DemoFrame .在 DemoFrame 中,我使用关键字super"设置了页面标题,例如:

I am new to Java. My problem is that I have a class names MyClassExp. I have extended it from JFrame. Inside the class, I initiate an object of another class named TabbedFrame. TabbedFrame also extends a class DemoFrame . In DemoFrame, I have the title of the page set using keyword 'super' like:

super("Some Title");

现在当我运行 MyClassExp 时,即使在创建 JFrame 之后:

Now when I run my MyClassExp, even after creating a JFrame as:

new JFrame("New Title"); 

我仍然得到相同的标题,即一些标题.有没有办法解决这个问题?我已经尝试了很多解决它但失败了:'(

I'm still getting the same title i.e Some Title. Is there any way to solve this problem? I've tried a lot to solve it but failed :'(

推荐答案

使用API​​方法public void setTitle(String title).

这篇关于将标题设置为 JFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆