Click to See Complete Forum and Search --> : setTitle() behaviour


Giovanni Pierandrea
March 6th, 1999, 06:47 PM
Hi,


Hi! Look at this program:


--------

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.event.*;


public class TitleTest extends JFrame

{

public TitleTest()

{

setSize(200, 100);

setTitle("Title test");

show();

System.out.println(getTitle());

}


static TitleTest tt;

public static void main(String[] args)

{

tt = new TitleTest();

}

}

--------

It works fine unless I swap the lines with setTitle("Title test"); and

show();. Namely, in the latter case the window appears without

a title. Why is this? I would like to be able to set the title

after the window has been shown.


Thanks in advance!

SINGH
March 8th, 1999, 04:48 AM
hi,

Try out..

show

settitle

show


Regards,

Singh