Search This Blog

Showing posts with label java app. Show all posts
Showing posts with label java app. Show all posts

How to Launch a Application or Executable Using Java Code with Command Line Arguments

In this post, we shall see how to launch an application with its command line arguments using Java code. Most applications take path of a file as command-line argument to open it. If we give path of an image file to mspaint application as command-line argument, the image will be opened in paint. The following java program launches mspaint with a command-line argument which is a path to an image.

 try
 {
 Runtime.getRuntime().exec("C:\\Windows\\System32\\mspaint.exe \"C:\\Users\\Shareef\\Desktop\\flower.jpg\"");
 } catch (IOException ex) {}

Arguments are separated by spaces. If a command-line argument contains space within it (such as a space in a path), it is recommended to enclose it within brackets.

Simple Pause and Resume Supported Download Manager using Java

In this post i am adding a simple download manager made using java programming language. The file is light weight. This java application supports pause and resume. You can resume a paused download at any time if the url is resume supported. This java desktop application maintains a simple download queue. You can directly drag and drop download links into this java download manager app or add paste links. When the app exits, it saves it current progress and download queue so that you can easily resume the download in this java download manager desktop app when you start the application later.
free download manager for computer in java. lightweight and compact
Free Java Download Manager for 

Features:

  • Light weight
  • Pause and resume supported
  • Drag and drop download links
  • Download queuing supported.
  • Source code available


Download DownloadManager.jar (app) here.


Simple Java Calculator Program Using Java Applet

Java calculator application using java applet JAppet and Swing components. how to make Simple java calculator applet. Java program source code for simple calculator applet
Screenshot of Simple calculator applet in java
This post shows a sample Calculator Program using Java Applet. This program uses the JApplet Class and Swing components in the program. The full source code is given below. This is a java Applet program for a simple calculator with operations addition, subtraction, division and multiplication on floating point numbers. It also have the C (clear) button. This Java Calculator applet was created by myself for my practical lab experiment. I think this may be useful for beginners in java.