Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Getting System Information (Outdated applet blocked by security)

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Getting System Information (Outdated applet blocked by security)

    This code is a bit outdated.
    Is there a way to run a similar code with today's java?

    import com.sun.servicetag.SystemEnvironment;
    import java.lang.management.ManagementFactory;
    public class Config extends java.applet.Applet{
       public void paint(java.awt.Graphics g){
            g.drawString("Hi.. This is Venkatesh..",50,10);
            SystemEnvironment se = SystemEnvironment.getSystemEnvironment();
            g.drawString("CpuManufacturer:"+se.getCpuManufacturer(),50,40);
            g.drawString("HostID:"+se.getHostId(),50,60);
            g.drawString("Host Name:"+se.getHostname(),50,80);
            g.drawString("OS Architecture:"+se.getOsArchitecture(),50,100);
            g.drawString("OS Name:"+se.getOsName(),50,120);
            g.drawString("OS Verstion:"+se.getOsVersion(),50,140);
            g.drawString("Serial no:"+se.getSerialNumber(),50,160);
            g.drawString("System model:"+se.getSystemModel(),50,180);
            g.drawString("System Manufacturer:"+se.getSystemManufacturer(),50,200);
            com.sun.management.OperatingSystemMXBean mxbean = (com.sun.management.OperatingSystemMXBean)ManagementFactory.getOperatingSystemMXBean();
            g.drawString("Available Processors:"+mxbean.getAvailableProcessors(),50,220);
     g.drawString("TotalRAM:"+mxbean.getTotalSwapSpaceSize()/(1024*1024*1024)+""+"GB",50,240);
      g.drawString("RAM SIZE :" + (mxbean.getTotalPhysicalMemorySize()/(1024*1024*1024))+ " GB ",50,260);
        }
    }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Getting System Information (Outdated applet blocked by security)

    Welcome to the forum! Thank you for taking the time to learn to post code correctly. If you haven't already, please read this topic to learn other useful info for new members.

    The code could be updated by someone who knows how to program in Java. What are you asking? If you're unable to do it yourself and are interested in hiring somebody to do it for you, there is a paid projects section in which you could advertise the work.

Similar Threads

  1. Is this book too outdated?
    By Capsclock in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: January 21st, 2014, 07:31 PM
  2. Java applet error: "Blocked Exception"
    By kinkita in forum Java Applets
    Replies: 7
    Last Post: July 12th, 2013, 01:11 PM
  3. Applet Security issue
    By DanBrown in forum AWT / Java Swing
    Replies: 5
    Last Post: February 4th, 2011, 09:50 AM
  4. Applet Security Warning & Class Loaders
    By tess in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 2nd, 2010, 01:41 PM