set title to JFrame(将标题设置为 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将标题设置为 JFrame
基础教程推荐
- Struts2 URL 无法访问 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
