The Artima Developer Community
Sponsored Link

Java Answers Forum
small help of replacing event handler with the Swing

1 reply on 1 page. Most recent reply: Apr 25, 2003 4:41 AM by Singh M.

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 1 reply on 1 page
Ajay

Posts: 8
Nickname: aju
Registered: Apr, 2003

small help of replacing event handler with the Swing Posted: Apr 24, 2003 11:22 PM
Reply to this message Reply
Advertisement
Hi,
I was using handleEvent.. which is got depricated to capture the mouse position.. can anybody pls help me in replacing this with the swings ..
my present code is like
public boolean handleEvent(Event event)
{
if(event.id == 503)
{
if(DEFAULT_CURSOR != null)
setCursor((Cursor)DEFAULT_CURSOR);

xPos = event.x;
yPos = event.y;
if (showLabel)
{
repaint();
showLabel = false;
}

for (int i=0;i<totNoOfBar ;i++ )
{
if(((labelX <= (xPos +4)) && (labelX >= (xPos -4))) && ((labelY <= (yPos + 10)) && (labelY >= (yPos - 10))))
{
repaint();
showLabel = true;
}
}
}
return super.handleEvent(event);
}



my req is::
i need to capture the mouse event and i need to show floating text on some region in the applet..
if anybody can help would be highly appreciable..
regrds
Aju


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: small help of replacing event handler with the Swing Posted: Apr 25, 2003 4:41 AM
Reply to this message Reply
Do what the java documentation says... make use of the methid processEvent

Flat View: This topic has 1 reply on 1 page
Topic: palindrom function Previous Topic   Next Topic Topic: Passing a class to a class

Sponsored Links



Google
  Web Artima.com   

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