将标题设置为JFrame

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

super("Some Title"); 

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

 new JFrame("New Title"); 

我仍然得到相同的标题,即一些标题。 有什么方法可以解决这个问题吗? 我已经尝试了很多来解决它但失败了:’(

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

MyClassExp类的constructor使用this.setTitle(String title)方法。

只需使用setTitle(“yourTitleName”);

例如:

 setTitle("Currency Converter"); textField.addKeyListener(this); combo.addItemListener(this); label.addMouseListener(this); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);