Posts

Showing posts from June 23, 2010

How to get file name in java code, example

 public static String getFileName(String filePath)     {         File f = new File(filePath);         return f.getName();     }

How to get file exist or not in java code example

This method is used to check that file is exist or not on your given path.  public static boolean getFileExist(String filePath)     {         File f = new File(filePath);         return f.exists();     }

How to get file size in java code, example?

 How to get file size in java code, example Now we are writing a very simple code for find the file size in java. Copy and paste this code in your java class. public static long getFileSize(String filePath)     {         File f = new File(filePath);         return f.length();     }

How to delete file in java code example?

 Delete file in java code example Here we are describing how to delete file in java code example. Very simple code method is there. public boolean setDeleteFile(String filePath)     {         File f = new File(filePath);         return f.delete();     }

Draw Image button with link in java applet code.

import java.applet.Applet; import java.awt.*; import java.net.MalformedURLException; import java.net.URL; public class ImageButton extends Canvas {     public ImageButton()     {         staticImage = null;         activeImage = null;         linkURL = null;         buttonUp = true;         mouseOver = false;     }     public ImageButton(Applet app, String toolType, int border)     {         staticImage = null;         activeImage = null;         linkURL = null;         buttonUp = true;         mouseOver = false;      ...

How to draw ruler in applet code

import java.io.PrintStream; public class Ruler extends Button {     public Ruler()     {         mid1 = 77;     }     public void init()     {         setBackground(Color.GRAY);     }     public void paint(Graphics g)     {         drawNum(g, 10, 520, 12, mid1, 1);         drawRuler(g, 10, 520, 8);     }     private void drawRuler(Graphics g, int left, int right, int level)     {         if(level < 1)         {             return;         } else         {  ...

How to convert Video to FLV for Flv Player ? : java code , Examples

How to convert Video to FLV for Flv Player public int compressVideioFLV(String inputVideo, String outputVidio) {         int returnCode = 0;         Process process;         try {             System.out.println("compressVideioFLV called");             System.out.println("inputVideo:"+inputVideo);             System.out.println("outputVidio:"+outputVidio);             String[] command = { "ffmpeg", "-i", inputVideo , "-ar", "22050", "-ab", "32","-f","flv","-s","422x252", outputVidio};             System.out.println("11:");             process = Runtime.getRuntime().exec(command);   ...

Recent Post

Recent Posts Widget