The Artima Developer Community
Sponsored Link

Java Answers Forum
The size of a PopUp menu

2 replies on 1 page. Most recent reply: Jun 7, 2006 10:48 PM by Matthias Neumair

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 2 replies on 1 page
Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

The size of a PopUp menu Posted: May 25, 2006 2:18 AM
Reply to this message Reply
Advertisement
How do I get the actual size of a JPopupMenu before it was drawn the first time?
I only get (0,0).

If I set it to visible and then hide it again, the size is correct. Is there a way to do it without showing it?


Sanjay Perera

Posts: 42
Nickname: angel6
Registered: Apr, 2004

Re: The size of a PopUp menu Posted: Jun 7, 2006 8:35 PM
Reply to this message Reply
Try getPrefferedSize(). It worked for me. I guess getting preffered size won't be a problem since you hardly specify the preffered size for a JPopupMenu.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: The size of a PopUp menu Posted: Jun 7, 2006 10:48 PM
Reply to this message Reply
That worked, thanks

Flat View: This topic has 2 replies on 1 page
Topic: Replacing the CANVAS with other Previous Topic   Next Topic Topic: I need java code to flatten an image

Sponsored Links



Google
  Web Artima.com   

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