Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set title to JFrame

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");

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 :'(

like image 607
Abdus Sami Khan Avatar asked Feb 18 '23 13:02

Abdus Sami Khan


2 Answers

Use the API method public void setTitle(String title).

like image 199
Juvanis Avatar answered Mar 03 '23 11:03

Juvanis


- Inside the MyClassExp class's constructor use this.setTitle(String title) method.

like image 41
Kumar Vivek Mitra Avatar answered Mar 03 '23 11:03

Kumar Vivek Mitra