Solved

Can't lock setCursor in a JComponent

Posted on 2006-06-21
9
359 Views
Last Modified: 2013-11-23
I had implemented a mouse listener to change cursor according the task in a jcomponent, but whe cursor reach another instance of a this jcomponent, the cursor change again. I need that the cursor stay locked to the component where mouse was pressed until I release it. How can I avoid this undesired change?
0
Comment
Question by:rubentrancoso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 16957411
you cannot stop the cursor leaving the bounds of a component afaik
and if you want the cursor to stay the same when in other components tyou need to set the cursor for all components you want it to take effect in.
0
 

Author Comment

by:rubentrancoso
ID: 16957425
unbelivable! :/
you mean that every time I press the mouse button in a component to move it in a JPanel i.e. I want to notify all widgets in my application to not change it until released???
it's almos impossible to maintain.
0
 

Author Comment

by:rubentrancoso
ID: 16957436
Maybe there's a way yo change the cursor in toolkit in a global way
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:rubentrancoso
ID: 16957440
"A change in the cursor occurs only when it is over the component that has set it. If you want to set the cursor for the whole window (JFrame), you need to set it for the content pane of the window."
0
 
LVL 92

Expert Comment

by:objects
ID: 16957442
sounds like what you want is to change the cursor for the entire container, instead of the individual component.
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 16957444
Yes, the cursor in JAVA has some weird weaknesses; it's also impossible to provide your own busy cursor.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16957470
Cursor.getPredefinedCursor ( Cursor.WAIT_CURSOR ) ; ?
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 16957501
mayankeagle, just take an animated gif; put it in a JLabel and it lives,
try to use it as a cursor ... and it's dead.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16957823
In that case - yes.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 87
Tomcat: Unable to run tomcat service. 2 30
Website checklist for browser compatibility? 2 39
Java array sort 10 35
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question