sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Play an Audio File
http://sunrays-java-utilities.blogspot.com/2011/08/play-audio-file.html
Tuesday, August 9, 2011. Play an Audio File. Play an audio file from java program. Import java.io.FileInputStream;. Import java.io.InputStream;. Import sun.audio.AudioPlayer;. Import sun.audio.AudioStream;. Public class PlaySoundFile {. Plays audio from given file names. */. Public static void main(String[] args) throws Exception {. String fileName = "D:/songs/laila.wav";. InputStream in = new FileInputStream(fileName);. Create an AudioStream object from the input stream. Similarly, to stop the audio.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Get System Processor, Memory, Drives
http://sunrays-java-utilities.blogspot.com/2011/08/get-system-processor-memory-drives.html
Monday, August 8, 2011. Get System Processor, Memory, Drives. A Program to get your System Information. Available, Free and Maximum memory. File System ( Number of Drives ). Import java.io.File;. Public class GetSystemInfo {. Public static void main(String[] args) {. Total number of processors or cores available to the JVM */. System.out.println("Available processors (cores): ". Runtime.getRuntime().availableProcessors() ;. Total amount of free memory available to the JVM */. No limit" : maxMemory) ;.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Shutdown Computer - Cross Platform
http://sunrays-java-utilities.blogspot.com/2011/08/shutdown-machine.html
Tuesday, August 9, 2011. Shutdown Computer - Cross Platform. Program to Shutdown Machine. Public class ShutdownMachine {. Public static void main(String[] args)throws Exception {. String operatingSystem = System.getProperty("os.name");. Mac OS X".equals(operatingSystem) {. ShutdownCommand = "shutdown -h now";. Else if ("Windows".equals(operatingSystem) {. ShutdownCommand = "shutdown.exe -s -t 0";. Throw new RuntimeException("Unsupported operating system.");. Subscribe to: Post Comments (Atom).
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Text Editor - Using Swing
http://sunrays-java-utilities.blogspot.com/2011/08/text-editor-using-swing.html
Thursday, August 11, 2011. Text Editor - Using Swing. Program to develop a full functional Text Editor. That create and update a file. Editor will have following features :. 1 Create new Text file. 2 Open existing text file and modify. 3 Change font to Bold and Italic. 4 Change font to Serif or Santserif or Courier. 5 Change Foreground and Background colors. See http:/ aj.sunrays.co.in/Home/swing-1/project- -text-editor. Subscribe to: Post Comments (Atom). There was an error in this gadget.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Determine the IP address of a website
http://sunrays-java-utilities.blogspot.com/2011/08/determine-ip-address-of-website.html
Sunday, August 7, 2011. Determine the IP address of a website. You can use Java to determine the IP address of any website. Import java.net.InetAddress;. Import java.net.UnknownHostException;. Public class GetIPAddress {. Public static void main(String[] args) {. Google.com", "yahoo.com", "hotmail.com" etc. String hostName = "google.com";. InetAddress in = InetAddress.getByName(hostName);. System.out.println("The IP Address of site is:". Catch (UnknownHostException e) {. August 7, 2011 at 10:59 PM.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: August 2011
http://sunrays-java-utilities.blogspot.com/2011_08_01_archive.html
Thursday, August 11, 2011. Text Editor - Using Swing. Program to develop a full functional Text Editor. That create and update a file. Editor will have following features :. 1 Create new Text file. 2 Open existing text file and modify. 3 Change font to Bold and Italic. 4 Change font to Serif or Santserif or Courier. 5 Change Foreground and Background colors. See http:/ aj.sunrays.co.in/Home/swing-1/project- -text-editor. Calculator using Swing classes. Tuesday, August 9, 2011. Program to Shutdown Machine.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Calculator using Swing classes
http://sunrays-java-utilities.blogspot.com/2011/08/calculator-using-swing-classes.html
Thursday, August 11, 2011. Calculator using Swing classes. Program written in Java Swing components to write live Calculator. See : http:/ aj.sunrays.co.in/Home/swing-1/calculator. Subscribe to: Post Comments (Atom). There was an error in this gadget. Text Editor - Using Swing. Calculator using Swing classes. Shutdown Computer - Cross Platform. Play an Audio File. Get System Processor, Memory, Drives. Get Data from a URL. Determine the IP address of a website. 91 731 4249244, 98273 60504.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Call an Exe
http://sunrays-java-utilities.blogspot.com/2011/08/call-exe.html
Monday, August 8, 2011. Call an exe file with parameters from Java. Import java.io.IOException;. Public class RunAnExe {. Public static void main(String[] args) {. Runtime rt = Runtime.getRuntime();. Process p =null;. P = rt.exec("notepad c:/test.xml");. Catch (IOException e) {. System.out.println("Exe does not exist or access rights issues". System.out.println("Process Exit Normally" p.exitValue() ;. Subscribe to: Post Comments (Atom). There was an error in this gadget. Text Editor - Using Swing.
sunrays-java-utilities.blogspot.com
SunilOS JAVA Utility Classes: Get Data from a URL
http://sunrays-java-utilities.blogspot.com/2011/08/get-data-from-url.html
Monday, August 8, 2011. Get Data from a URL. This program will read data from a Web URL and write to Console. This program can be used to make a Custom Web browser. Import java.io.InputStream;. Import java.net.URL;. Import java.util.Scanner;. Public class GetDataFromURL {. Public static void main(String[] args) throws Exception {. URL yahoo = new URL("http:/ www.yahoo.com/");. InputStream inStream = yahoo.openStream();. Scanner in = new Scanner(inStream);. While (in.hasNext() {. Text Editor - Using Swing.
SOCIAL ENGAGEMENT