This tutorial will teach you How to Find the Machine Name of Computer using Java.
Paste the Code inside the Find Button
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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.