将标题设置为 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)
.
相关文章