This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes Jxam Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Jxam Question" Watch "Jxam Question" New topic

Jxam Question

Vipin Dube

Joined: Feb 02, 2001
Posts: 5
I am sending one question from Jxam exam simulators
Q . We have created a Frame which is initialy invisible, by using which of the following method we can make the frame visible (select one or more)
a. setBounds()
b. setSize()
c. setVisible()
d. show()
Please, answer the above question with explanation.
Ans. according to Jxam is a,b,c.
Sai Ram9

Joined: Feb 13, 2001
Posts: 18
Hi vipin,
initially u set the bounds of a frame by calling setBounds(),
Then u set the size of the frame by calling setSize().
Then u make it visible by calling setVisible().
u can make the frame visible only if u have set the bounds and the size, if u do not specify them its not use in just making the frame visible which has not set its size.
Hope this Helps!
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
The question needs to be reworded to arrive at the solution that the author gets to! New question:
We have created a Frame which is initially invisible. Which of the following methods could be combined to make the frame visible?
Sai is correct in the sense that you need to use more than one command to get the frame visible. The technically correct answer would be that a program could perform the following two steps:
a and then c, or
b and then c.
Since the setBounds method requires x, y, width, and height, it would be redundant to then call setSize because you just set the size already! On the other hand, you can just call setSize because the window system will supply x and y values for you (usually zeros ...).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Jxam Question
It's not a secret anymore!