Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String Action

 
raph1979
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Again Everybody
Hi just want to know if its possible to do some action on a String like double click on it and do some events or simple click, etc
Thanks in advance
Raph
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is this String? If it is painted in a Panel or Canvas, you simply need to add a MouseListener to the Canvas or Panel, and capture MouseEvents which occur within the co-ordinates of the String. If this String is in a List, combo box, etc., different actions are already prescribed for these components when something in them is chosen. If the string is on the console ( i.e. DOS window your program is running in ), then you cannot do it... You can not capture events without a GUI...

HTH,
-Nate

P.S. - Please re-register with a name that follows the JavaRanch naming conventions. Thank you.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. 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!