The Artima Developer Community
Sponsored Link

Java Answers Forum
Title Bar

3 replies on 1 page. Most recent reply: Sep 26, 2003 5:57 AM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Kevin

Posts: 27
Nickname: quasi
Registered: Apr, 2003

Title Bar Posted: Sep 25, 2003 4:57 AM
Reply to this message Reply
Advertisement
I am making a JAVA application to run on a UNIX system and have encountered a few probelms.
-1) A title bar doesn't appear
-2) It opens up in the top left hand corner of the screen

Is there any way to fix these.
Thanx for any help in advance


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Title Bar Posted: Sep 25, 2003 8:02 AM
Reply to this message Reply
      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
 
      if (size.height > screenSize.height)
      {
         size.height = screenSize.height;
      }
      if (size.width > screenSize.width)
      {
         size.width = screenSize.width;
      }
      frame.setLocation((screenSize.width - size.width) / 2, (screenSize.height - size.height) / 2);
      setVisible(true);
 


and let me know how u are setting the title bar ??

Kevin

Posts: 27
Nickname: quasi
Registered: Apr, 2003

Re: Title Bar Posted: Sep 26, 2003 5:43 AM
Reply to this message Reply
Thanx for the help. I fixed the title bar problem

Just one other question is there any way to center the text in the title bar

mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Title Bar Posted: Sep 26, 2003 5:57 AM
Reply to this message Reply
either use the SwingConstants.Center for the alignment....

Else set the label text in html tag...later version of jdk support html formatting....

like set the text in ur titleBar as

"<html><center>urText</center></html>"

Flat View: This topic has 3 replies on 1 page
Topic: Displayin an integer in an applet Previous Topic   Next Topic Topic: interface reference assignment

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use