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
467

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

    Laravel 11 CRUD Mastering RESTful API MVC with Repository Pattern

    In this tutorial will teach Laravel 11 Api MVC with Repository Pattern Crud Application st…