how to set the location of mouse pointer?

When I use JcomboBox to enter a new item (from a blank item),the mouse pointer is not set at the beginning of the blank. Sohow to set the mouse pointer to a particular location?Thank you.
[215 byte] By [javafan863] at [2007-9-30 17:33:06]
# 1
Please elaborate
Lutha at 2007-7-6 13:56:25 > top of Java-index,Security,Event Handling...
# 2
computer users usually don't like it when their mouse pointer is moved without their permission but look here: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Robot.html
jsalonen at 2007-7-6 13:56:25 > top of Java-index,Security,Event Handling...
# 3

Suppose one wants to let an Applet user to enter a new item in a JComboBox

and the permission is given whenever the blank item (which is one existing

item in the JComboBox designed by the programmer) is selected. However,

when one selects the blank item, the cursor does not blink at the beginning

of the blank (similar to a JTextField, the cursor is not at the left end). So if the

user does not left-shift the cursor, after entering an item, for example "cat",

the item appears as "cat", and NOT "cat " as desired. So the key is

to set the cursor at the beginning so that users do not need to left-shift the

cursor (save users some work) to get the desired "cat".

javafan863 at 2007-7-6 13:56:25 > top of Java-index,Security,Event Handling...
# 4
Can't you use a really blank element, "", instead of an element that contains a whitespace character " " ? Or do I miss the point completely?
jsalonen at 2007-7-6 13:56:25 > top of Java-index,Security,Event Handling...
# 5

add a selection listener, and in there:

[code]

if("".equals(cb.getSelectedItem())) {

ComboBoxEditor editor = cb.getEditor();

cb.configureEditor(editor, "");

cb.setSelectedItem(editor.getItem());

}

[code]

Maybe... although, I believe if you select any item on an editable checkbox, the value is selected and focused.

Actually, sounds like your blank item is " " and not ""

bsampieri at 2007-7-6 13:56:25 > top of Java-index,Security,Event Handling...