Java Programming : Event Handle by Using Keyboard

in utopian-io •  7 years ago  (edited)

What Will I Learn?

  • We will learn the concept of Event Handle in Java programming

Requirements

-Java Development Kit (JDK) must be installed.

-Also the computer system must have Java IDE installed. Probably Netbeans.

Difficulty

  • Intermediate

Tutorial Contents

we are going to learn the events handling in Java programming. Sometime, the users prefer clicking by using the keyboard than using the mouse. The sum operation can be done by entering keyboard below. The code is added is

if(e.getKeyCode()==e.VK_ENTER)

the full code below

private void resultKeyPressed(java.awt.event.KeyEvent evt) {                                  
        // TODO add your handling code here:
        if(e.getKeyCode()==e.VK_ENTER)
{
int x=Integer.parseInt(data1.getText());

int y=Integer.parseInt(data2.getText());
String z=String.valueOf(x+y);
result.setText(z);
}

    }                    

The result is displayed in picture below
jv.jpg

my project is in github

Curriculum

This is my first tutorial about Java programming



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your contribution cannot be approved because it is not as informative as other contributions. See the Utopian Rules. Contributions need to be informative and descriptive in order to help readers and developers understand them.

My Opinion:

  • The tutorial is very small and not detailed.
  • The information about your tutorial already exists on the internet and very well detailed.

You can contact us on Discord.
[utopian-moderator]

Hey @portugalcoin, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Are you a programmer ? , I know just basic Java c c++ ,

  ·  7 years ago (edited)

yes

yes

Congratulations @ighfar! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Do not miss the last announcement from @steemitboard!

Congratulations @ighfar! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Do not miss the last post from @steemitboard:

Carnival Challenge - Collect badge and win 5 STEEM
Vote for @Steemitboard as a witness and get one more award and increased upvotes!

Congratulations @ighfar! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

Use your witness votes and get the Community Badge
Vote for @Steemitboard as a witness to get one more award and increased upvotes!