Home Java How to Find the Machine Name of Computer using Java

How to Find the Machine Name of Computer using Java

43 second read
0
0
497

This tutorial will teach you How to Find the Machine Name of Computer using Java.

Paste the Code inside the Find Button

 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        String hostname;
        try
        {
            InetAddress address;
            address = InetAddress.getLocalHost();
            hostname = address.getHostName();
          
            JOptionPane.showMessageDialog(this, hostname);
        }
        catch (Exception ex)
        {
         
        } 
    }

i have attached the video link below. which will do this tutorials step by step.

 

    Load More Related Articles
    • Conditional Statements in Python

      Conditional statements in Python allow us to control the flow of execution based on condit…
    • Java Beans

      A Java Bean is a reusable software component that follows a specific set of conventions. J…
    • Java String Methods

      Java provides a rich set of built-in methods for handling String operations efficiently. S…
    Load More By admin
    • Java Beans

      A Java Bean is a reusable software component that follows a specific set of conventions. J…
    • Java String Methods

      Java provides a rich set of built-in methods for handling String operations efficiently. S…
    • Java Developer Jobs

      Java remains one of the most in-demand programming languages worldwide, powering everythin…
    Load More In Java

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Check Also

    Conditional Statements in Python

    Conditional statements in Python allow us to control the flow of execution based on condit…