Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

R&H test question on Frames

 
Kamakshi Mahadevan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make a frame f appear on the screen, you have to call:
a)f.setSize(300,200)
b)f.setVisible(true)
c)f.setForeground(Color.white)
d)f.setFont(new Font("Sans Serif", Font.BOLD,24)
The answer is: a & b
when i tried a program with setVisible(true) and no setSize(), it still displays a frame with just the title bar & the 3 buttons for minimize, maximize & close. When I click on the maximize button, the frame occupies the entire screen.so the frame appears on the screen with no setSize().
So, I think the answer is b.
i saw a similar question in Jxam.
can anybody tell me if I am missing something here??
thanks
kamakshi

 
Nijeesh Balan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kamakshi,
Even I would support your point..I answered B but later found the answer to be A and B..
Others please do clarify...
Thanks
Nijeesh
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!