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
488

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
    Load More By admin
    Load More In Java

    Leave a Reply

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

    Check Also

    Employee Working Hours Calculation System using C#.net

    Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the f…