|
-
March 6th, 1999, 07:47 PM
#2
setTitle() behaviour
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|