Well i just got it, id like to say thanks for all the help, it was quite a little change.

public static void main(String[] args){



        
        String input = null;
        String Output = null;
        

        String In = JOptionPane.showInputDialog(null," Please enter a file plus its dot format");

        int index = In.lastIndexOf('.');

      String one = In.substring(index + 1);

     
     
        JOptionPane.showMessageDialog(null," You choose the " +one + " format");

Using the 'lastIndexOf' was a good idea. In that way you can handle inputs such as: "file.name.txt";

why don't you save it as something like .bat .doc .html .ppt etc

if this does not work send me an e-mail at my PC shop

<<snip>>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.