Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem calling setVisible(true) ?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All;
In my application, I am using JFrame and added some component. At last I called setVisible(true); method. But it cann't works.
Then I tried with show() method. but the result is same.
Then I tried with isDisplayable() method, but strange ,it is returning fasle.
Now my problem is why it is hanging on calling the setVisible() method. or why it is returning false for isDisplayable().
Can anybody guide me to solve the problem.
Thanks in advance.
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post some of your code here?
Just few priliminary checks -
have you called frameName.setSize(x,y); or frameName.pack(); before calling setVisible(true)?
(I am sure, you must have, but just in case....)
- Manish
 
Sumeet Gaikwad
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manish,
Thanks for your reply. but I am unable to post the code because of 2550 lines.
Yes, I called the setSize method

but i never called pack method in my code.
Still facing the same problem. One more thing I am using jdk1.3.1 because of some reason.
Plz reply to hang out of this.
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I don't get why it is not working, but there is something in this line: setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
From what I understand, screenSize.width and frameSize.width are equals. So (screenSize.width - frameSize.width) / 2, should give you 0/2 . Isn't it a problem?
 
Sumeet Gaikwad
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

So (screenSize.width - frameSize.width) / 2, should give you 0/2 . Isn't it a problem?


Thanks for reply but that is not a problme. ??
Any more suggetions.
 
Destroy anything that stands in your way. Except this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic