Java-Swing UI Types



For desired [Among available types :P ] look and feel for your Java-swing application, you may set like below..

UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());
           
setLookAndFeel() method takes a String argument   which is one of below available look and feel:


  1. ·         UIManager.getSystemLookAndFeelClassName (); //Windows style..
  2. ·         UIManager.getCrossPlatformLookAndFeelClassName();//Java swing standard
  3. ·         "com.sun.java.swing.plaf.motif.MotifLookAndFeel" //Moti style.



Happy coding :)

Jyotishya Desktop application

My first-public-free-software application developed using Java :)

Everything starts @ Jyotishya. [https://github.com/look4chandu/Jyotishya]

More stuffs are on the way..

So..keep peeping and share yours too... ;)


Happy coding :)

Java : system / Environment properties


There was a need to determine the OS on which my application is running. So come across system properties method in java. Sharing the same with you..

/**
       * I could able to get below properties..!!
       
  java.runtime.name, sun.boot.library.path, java.vm.version, java.vm.vendor,
  java.vendor.url,  path.separator, java.vm.name, file.encoding.pkg,
  user.country, user.script, sun.java.launcher,  sun.os.patch.level,
  java.vm.specification.name, user.dir, java.runtime.version,
  java.awt.graphicsenv,  java.endorsed.dirs, os.arch, java.io.tmpdir,
  line.separator, java.vm.specification.vendor, user.variant,
  os.name, sun.jnu.encoding, java.library.path, java.specification.name,
  java.class.version,  sun.management.compiler, os.version, user.home,
  user.timezone, java.awt.printerjob, file.encoding,
  java.specification.version, java.class.path, user.name,
  java.vm.specification.version, sun.java.command,  java.home,
  sun.arch.data.model, user.language, java.specification.vendor,
  awt.toolkit, java.vm.info,  java.version, java.ext.dirs,
  sun.boot.class.path,
  java.vendor, file.separator,  java.vendor.url.bug, sun.io.unicode.encoding,
  sun.cpu.endian, sun.desktop, sun.cpu.isalist
       
       */
      @SuppressWarnings("rawtypes")
      private static void printSystemProperties(){
            Properties properties=System.getProperties();
            String key;
            Enumeration keys=properties.keys();
            while(keys.hasMoreElements()){
                  key=(String)keys.nextElement();
                  System.out.println("\n");
                  System.out.println("key :"+key);
                  System.out.println("value :"+properties.getProperty(key));
            }
      }
Happy coding :)