This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes getRowForLocation(...) in JComboBox? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "getRowForLocation(...) in JComboBox?" Watch "getRowForLocation(...) in JComboBox?" New topic
Author

getRowForLocation(...) in JComboBox?

Meyer Florian
Ranch Hand

Joined: Oct 20, 2003
Posts: 62
Hey there!
In JTree or JList etc. I have a method like "getRowForLocation(int x, int y)" or "rowAtLocation(Point p)".
Do you know how to find out the row-for-location in a JComboBox?
Thanks!
Praiser
Krishna Mohan
Ranch Hand

Joined: May 30, 2003
Posts: 44
Iam not sure I understood your question.
Are you trying to find out index of the element or a
element at a index in JComboBox?


Programming is Fun.
Meyer Florian
Ranch Hand

Joined: Oct 20, 2003
Posts: 62
The methods e.getX() and e.getY() give me the current mouse position.
The method getRowForLocation(...) or rowAtLocation(...) give me the index of the row that the mouse cursor is over (not the selected row).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getRowForLocation(...) in JComboBox?
 
Similar Threads
symbol : constructor JComboBox(java.lang.String[],int,int)...cannot find symbol
cannot find symbol
drop down menu
getRowForLocation(int x, int y)
SWING Repaint question