Set name for JFrame

I am new to Java. My problem is that I have MyClassExp class names. I expanded it from JFrame. Inside the class, I initiate an object of another class called TabbedFrame. TabbedFrame also extends the DemoFrame class. In DemoFrame, I have a page set header using the keyword "super", for example:

super("Some Title"); 

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

 new JFrame("New Title"); 

I still get the same name ie Some Title. Is there any way to solve this problem? I tried a lot to solve, but could not: '(

+4
source share
3 answers

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

+6
source

- In the MyClassExp constructor class, use the this.setTitle(String title) method.

+2
source

Just use setTitle ("yourTitleName");

eg:

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

Source: https://habr.com/ru/post/1445214/


All Articles