answersLogoWhite

0


Top Answer
User Avatar
Wiki User
Answered 2009-01-18 20:08:40

Almost all controls' ActionListener triggers the actionPerformed upon the enter key press == == Using an anonymous class implementation:

Component c; // this is the component you want to add a listener to

c.addKeyListener(new KeyListener() {

public void keyPressed(KeyEvent e) {

if(e.getKeyChar() == e.VK_ENTER) {

// put the code you want to execute when Enter is pressed here

System.out.println("ENTER PRESSED");

}

}

// unused abstract methods

public void keyTyped(KeyEvent e) {}

public void keyReleased(KeyEvent e) {}

});

012
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Your Answer

Loading...

Still have questions?

Related Questions

Is dog responds and adjusts to changes?

Please re-write this so we can understand the question


What does inscribe mean?

write on/in stone, metal,paper;enter a name in a list write on/in stone, metal,paper;enter a name in a list write on/in stone, metal,paper;enter a name in a list


How do you write an essay about decent working conditions?

how do u write an essay about decent working conditions


How do you write Do Not Enter in Korean symbols?

Type your answer here... Do Not Enter is 출입금지 in Korean.


How do you write in gibberish?

"Gibberish" refers to speech or other use of language (such as writing) that is nonsensical, or what the listener (or reader) perceives to be nonsensical.


What is the write tall to enter a military school?

What is the write tall? What are you even asking?


How do you write Samantha listener of god in Hebrew?

samanta, shoma'at ha-el (סמנתה, שומעת האל)


How often do screenwriters write?

Working screenwriters write every day.


How I can unban me in counter strike 1.6?

Go start then run write cmd then enter write ipconfig /release then enter. You can also try to write ipconfig /renew then eneter you'll b unbanned.


You pressesd enter already didnt work help on poptropica 24 carrot typing in the code?

1 you need to write the password and press enter then you need to write the command and press enter. that's all


How do you write a letter for not working of street light?

give me an example of how do u write a complaint letter to electricity department for not working of street lights


How do you copy instructions given on a YouTube tutorial?

Well, just like in a classroom lecture, a YouTube listener can always write down the instructions.


How can you enter a YoVille in Facebook?

u gana to enter the facebook an write yoville game and u founde it tada


How do you enter 971 as numeric?

you write it as CMLXXl in roman numerals


What do you have to write for the wicked young writers award?

You can write anything to enter! It can be a poem, a short story, an essay....you name it! BUT... it must be under 750 words. You can enter if you are aged 5-25.


Why do USB flash drives stop working from write and erase cycles?

USB flash drives will stop working from write and erase cycles when there is a problem with the device.


Will the USB extension cables eventually stop working from the write and erase cycles?

No, the USB extension cables will not eventually stop working as a result of the write and erase cycles.


Will the USB memory card reader stop working from write and erase cycles?

No, the USB memory card reader cannot stop working from the write and erase cycles.


Will the USB memory card reader stop working from the write and erase cycles?

No, the USB memory card reader cannot stop working from the write and erase cycles.


Write a program to enter a character and it will tell the character etered?

{char a;...cout cin >> a;cout ...}


On the garmin etrex legend H GPS can you enter in coordinates?

Yes. You enter them as a waypoint, and then you can write information about it and assign a symbol.


How to write on the questionnaire on the pokemart?

When you enter the mart, there is a clipboard on the counter. Write "Link Together With All" on it and you will get Mystery Gift.


What is the homophone of enter?

access, excess write, right file, phial


When to use ENTER in Microsoft word?

To write the text in new line.


When working with exponents how do you write 4x4x4x4x4 as a power of 4?

45