How can we open any file using JAVA...

Hi all
i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();)
but the thing is how can i open that file for example if that file is HTML file then opens in IE or if that file is MS Word document that open in Word, like that
is there any suggestions
Thanx
Regards
Satinderjit

start is a windows command-line utility.
start foo.doc will start Word (or Star Office or Word Perfect or whatever is registered for the .doc extension),
start bar.htmnl will start your registered browser etc.

Similar Messages

  • How can I open ANY file on my PC. Used to use File Open filename

    Have Firefox 32.0.3.
    How can I open any file on my computer directly from firefox now?
    I used to just click on File>open>(filename) ie any of my Open Office files,
    Notepad files, or any other file on my PC. Don't seem to have this ability
    with the new menu icon, or am I missing something.

    hello cormact, you can customize the firefox interface and put the open file button into the firefox menu: [[Customize Firefox controls, buttons and toolbars]]
    or you can always open it with the keyboard shortcut ctrl+o....

  • How can i install any program using java code

     
    Hi friends,
    i want to know how can i install any software using c# code.

    Hi,
    You may change your title, Since this is C# forum.
     >>i want to know how can i install any software
    usingc# code
    So what kind of your software?
    In C#,we can install and uninstall "*.msi" files (setup).
    The code to install software without user interface is:
    private void installSoftware()
    Process p = new Process();
    p.StartInfo.FileName = "msiexec.exe";
    p.StartInfo.Arguments = "/i \"C:\\Application.msi\"/qn";
    p.Start();
    For more detailed information, please refer to article
    C# - Installing and uninstalling software in codeproject.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I open a program using Java and then perform certain tasks with it?

    For example, and this is just an example, I want to write a Java program that opens MS Paint and then manipulates that program. This can be useful to automate certain tasks.
    My question is whether this can be done writing Java code and if so how? If not possible, would I need to use a scripting language instead?

    write a Java program that opens MS Paint and then
    manipulates that program. This can be useful to
    automate certain tasks."manipulates" is a too wide term. Let me narrow down:
    1. If you want to open (run) the program and then shut (kill) it down it is possible and fairly trivial to do in java. Look up Runtime and Process classes in java.lang package
    2. If you want to open the program and edit some image/document in the opened program. It is very difficult in java. May be possible... using some Java/COM bridge, assuming your native program is COM/Active-x compliant. Note: these things go beyond the boundary of JVM and needs to interact with host OS and involves shared memory, ipc and all "low level" stuffs.
    If you want to be able to play around with these COM/Activex apps- choose .NET instead :-)
    3) You can open the program from java and pass it some command line arg as in (1) above and then the program will load that document/image at startup automatically. You may then edit the doc/image thru that program itself. However, Java is not doing anything for you here, other than just starting off your native mspaint.exe ot notepad.exe.
    -BJ
    Message was edited by:
    Bimalesh

  • How can I open zip files using 'zipfileviewer'?

    The app ZipFileViewer does not work for me and I would like to know what to do to correct this

    You'll need to talk to the developer of that app.

  • Open a file using java......... how?

    hi all
    I have a prob with my code
    the problem is by using the FileChooser like
    file = fileChooser.getSelectedFile();
    I have the file name but how can i open that file e.g. if file is word document then that file should open in word , if that file is HTML file then open in IE , and other files as well.
    is there any way to open a file
    plz help me
    Thanx
    Regards
    Satinderjit

    veer ji, try this code on your pc if you can. Click the print button and see that happens. thanx yuvraj:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    //import com.sun.java.swing.*;
    import javax.swing.*;
    public class ComponentPrinterFrame
    extends JFrame
    implements Printable {
    public static void main(String[] args) {
    ComponentPrinterFrame cpf = new ComponentPrinterFrame();
    cpf.setVisible(true);
    public ComponentPrinterFrame() {
    super("ComponentPrinterFrame v1.0");
    createUI();
    protected void createUI() {
    JPanel panel = new JPanel();
    JButton printButton = new JButton("Print");
    panel.add(printButton);
    panel.add(new JList(new Object[] { "One", "Two", "Three" }));
    panel.add(new JButton("Push me"));
    panel.add(new JCheckBox("Chess", true));
    panel.add(new JComboBox(new Object[] { "Eins", "Zwei", "Drei" }));
    printButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    PrinterJob pj = PrinterJob.getPrinterJob();
    pj.setPrintable(ComponentPrinterFrame.this);
    if (pj.printDialog()) {
    try { pj.print(); }
    catch (PrinterException pe) {
    System.out.println(pe);
    setContentPane(panel);
    setSize(400, 400);
    // Center.
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    int x = (screenSize.width - frameSize.width) / 2;
    int y = (screenSize.height - frameSize.height) / 2;
    setLocation(x, y);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    dispose();
    System.exit(0);
    public int print(Graphics g, PageFormat pf, int pageIndex) {
    if (pageIndex != 0) return NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D)g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    getContentPane().paint(g2);
    return PAGE_EXISTS;

  • How to open/read file using Java in Unix?

    Hi Friends,
    Can you please help me out how to open/read file using java in unix os? I have create one text file in "/home/test.txt" in unix environment. How to open the same file & read using java code?
    - Hiren Modi

    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • Hi when i switch on the macc 41 files open at once can not open any files while this is happing can still use AI & PS and the internet any help thanks...

    Hi when i switch on the macc 41 files open at once can not open any files while this is happing can still use AI & PS and the internet any help thanks...

    Are you wanting to stop the 41 files from opening at once or is this intentional? At what point do they open when you power on the mac or when you boot Illustrator? What OS version are you using?
    If you can  answer the questions above can provide better advice, but you may be running into something similar:
    http://www.mactip.net/stop-lion-restoring-previous-files-apps/

  • How can i open .mts files in premiere cs4?

    Hi all,
    I am using premiere cs4.
    when i import .mts file in cs4 it says file format is not supported.
    could any one please tell me how can i open .mts file in premiere cs4.
    Thanks
    Murali.

    What kind of audio did the camera record?  For example, the Sony NX5U can be set to record linear PCM audio, which will not import into CS4.  If the same camera is set to record AC3 audio, then the clips should import and play as expected.  This thread may help:
    Adobe Community: AVCHD audio
    Jeff

  • HELP! I attempted to erase free space and now I can't open any files!

    Hi everyone! I hope you can help me with my problem.
    Last night, I attempted to erase free space from my HD using disk utility. During the operation, the computer hung, so it wasn't able to complete 'creating temporary file' operation. So i had to stop the operation. And now, I can't open any files! Turns out my HD was full. But prior to my attempt to erase free space, I still had 25GB out of 55GB of free space. What happened? And how do I fix it? A lot of important files are in my HD and I don't want to lose any of it.
    Hope somebody could help me. Thanks a lot!
    allworkedup
    iBook G4 14"   Mac OS X (10.4.6)  

    Hi, Scary isn't it? I did the self same thing. Check your trash, you should see one or more disk images there. Empty the trash. All will be OK thereafter.
    If they're not there, restart and either the system will sort itself out or they will appear in the trash, so empty it.
    See here for my thread on the same subject.
    Good luck,
    Adrian
    Message was edited by Adrian: Oh, and Welcome to Discussions !!

  • How can i open neff files in elements 12

    how can i open neff files in elements 12

    http://helpx.adobe.com/creative-suite/kb/camera-raw-plug-supported-cameras.html
    http://helpx.adobe.com/x-productkb/global/camera-raw-compatible-applications.html
    Chances are you are simply using a brandnew camera and it isn't supported in any version of ACR yet.
    Mylenium

  • Can't Open any files in photoshop CS3

    I can not open any files in Photoshop CS3. It has been working fine. I was using camera raw and did not open the file and now can't open any file in photoshop. I reinstall it photoshop and it did not work. I reinstall install window xp worked fine until I tried camera raw. Canon (xti) Only cs3 is on the computer now

    reset the preferences per the faq?
    http://www.adobeforums.com/webx/.ef4a07f/1

  • How can I open raw files from my Nikon D7100 in CS4 or CS5?

    How can I open raw files from my Nikon D7100 in CS4 or CS5?

    Andy,
    In the simple and short form, what happens with the ACR (Adobe Camera RAW) module is that it gets updated with regularity, to accommodate the camera mfgr's. changes for their newer models. That ACR works within the host program, such as Ps, PsElements, Lightroom, etc.. At a point, Adobe ceases to support older host program versions. When that happens, the user has a few options:
    Upgrade the host program version
    Use another host program, such as PsElements or Lightroom
    Use the free DNG converter, per Curt's suggestion. That is not host program dependent
    Glad that the DNG Converter works for you.
    Good luck,
    Hunt

  • CAN NOT OPEN ANY FILE

    CAN NOT OPEN ANY FILE. USE W8 & ADOBE PHOTOSHOP CC 64B

    Welcome to the forum.
    Can you please provide us with more info, with which to work? This FAQ Entry will tell you what would be useful: http://forums.adobe.com/thread/1042147?tstart=0
    Good luck,
    Hunt

  • How can i open RAW files in Photoshop CS4 from Canon EOS 6D camera?

    How can i open RAW files in Photoshop CS4 from Canon EOS 6D camera?

    You can't directly but can use DNG Converter to convert your files so ACR can read and process them.
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

Maybe you are looking for

  • Unread emails originally appear as read

    My Q10 is set up to read 3 email accounts.  All three suffer the same problem, emails show up as having already been read - there is no distinction between before reading them for the first time on my Q10 and after reading them.  All three of these a

  • Bapi to post amount from one account to target account at BELNR level

    Hi , My requirement is like this. 1.based on comapny code and selection period by selecting BELNR ,I need to post document data (amount data) from source  account to target account,up on on  sucessfull transfer i need to debit the source account. 2.b

  • Text while entering reason for movement

    Dear all     When we are doing rejection say 10 out of 50 , then it is asking for reason for movement ..and also the text to be entered i want to know which table this text will be populated , Emergency thanks in advance

  • I have 0.07$ in my gift card how can i spend that to can change my country

    i want to put my visa but i must change my country first and becuz i have didn't spend my gift card first i can't ? so now i have just 0.07$ and noway i can spend that ?? i want any way to be 0.00$ so i can change the country and put my visa info plz

  • Why Does Copy And Paste In Premiere Pro perform so poorly?

    Please explain why you can't copy and paste footage (audio and/or video) into a chosen track on a sequence? It almost always pastes into a track with footage already there overlapping footage. It can't paste into a new track??? I thought this is simp