Skip to main content

Posts

Showing posts from May, 2013

How to read a file in Java ?

package com.file.read; import java.io.FileReader; import java.io.BufferedReader; import java.io.IOException; public class ReadFileInJava { public static void main(String[] args) { BufferedReader buffRead = null; try { String eachLine; buffRead = new BufferedReader(new FileReader("C:\\readfile.txt")); while ((eachLine = buffRead.readLine()) != null) { System.out.println(eachLine); } } catch (Exception e) { e.printStackTrace(); } finally { try { /* * close the BufferReader if there is any exception. */ if (buffRead != null)buffRead.close(); } catch (IOException ex) { ex.printStackTrace(); } } } }

How to Create First Application for Eclipse RCP ?

Following are the steps to create Basic Eclipse RCP plugin. Click on File. Select "Project ..." from sub Menu. 3. select "Plug-in Project" 4. click on "Next >" 5. Enter Project name. 6. click on "Next >" 7. select the option "This plug-in will make contribution to the UI" 8. Select "yes" as an option for the question "Would you like to create a rich client application?" 9. Click on "Next >" 10. Select "RCP 3.x Mail Template" 11. click on "Finish" Once you click on finish, the Plug-in project will be created as shown below: