CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    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!



  2. #2
    Join Date
    Mar 1999
    Posts
    14

    Re: setTitle() behaviour



    hi,

    Try out..

    show

    settitle

    show


    Regards,

    Singh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured