A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Swing / AWT / SWT
drawChars and onclick
Joined: Jun 27, 2008
Dec 06, 2010 10:52:11
Is it possible t o add an onclick handler (via a mask or directly to the text) to text rendered via drawChars.
if not how would i render a
component at the precise coordinates as the drawChars woudl have rendered.
Joined: Jul 26, 2007
Dec 06, 2010 19:58:07
One possible way.
When you invoke drawChars, compute and store int bounds as a Rectangle.
Add a mouse listener to the container on which the chars are drawn
When the user clicks, check if the click was inside any of the rectangles
How to ask questions
Donate a pint, save a life!
Onff-turn it on!
subject: drawChars and onclick
disabled attribute not rendered in commandButton
Script for clickOn() text will change the image
Double buffering / drawChars / flickering
form validator to check for alphabets in a text field
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014