How to position the cursor in File Name area in JFileChooser??

Hi,
I have been trying to position the cursor directly to filename area in JFileChooser. But no success.
It positions itself at the directory path by default.
How should I achieve this?
The problem is that I do not know the name of this
component used for File Name area hence difficult to
use "requestFocus() or getFocus()" like methods.
Thanks for your help.
-Manoj

Somewhere I saw a tip that explained how to do it, but I didn't keep a link to it. But basically it's like this: JFileChooser is a Container, so getComponent(n) will return the n-th component in the JFileChooser. One of them is the one you want to give the focus to, and I expect it will be a JTextField. A little experimentation should tell you which index you need to use.

Similar Messages

  • How to change the output executable file name(a.prj:(output)--- b.exe)

    LabWindows / CVI: how to change the output executable file name
                For example, I have an A project a.prj, I do not want to compile the output file is a.exe, but b.exe.
    I will try to save as a.prj b.prj, a.cws save as b.cws
    eg:a.prj  ---->(output)--->b.exe
    Solved!
    Go to Solution.

    You can go to Build >> Target Settings menu item, select Release (or Release 64) in the Configuration filed and set the name of the executable to create in Application FIle field, withouyt need to change the prj or cws filename.
    See the complete description of available options here.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    Clendenen02 wrote:
    2) It would be equally helpful if there was something that would take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste 
    and do this for all 700 files
    This Bash script will do it.
    Edit "PicDir" and "MovDir" to the location of your Folders
    (Note: The comment is written to the m4v file using xattr, so the Spotlight comment field appears blank in Finder, but the comment metadata is still indexed by Spotlight (If you add a Spotlight comment from Finder, it is stored both as an extended attribute and in a .DS_Store file)
    #!/bin/bash
    PicDir=$HOME/Desktop/Pictures
    MovDir=$HOME/Desktop/Movies
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" == "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [ -e "$MovDir"/$movname ]; then
                         xattr -w com.apple.metadata:kMDItemFinderComment "\"$comment\"" "$MovDir"/$movname
                   fi
              fi
         fi
    done

  • How to position the cursor at the end of the text with EDIT_TEXT?

    Hello, it wanted to ask to them if somebody could make work the module of function EDIT_TEXT so that it positions the cursor at the end of the text that is visualizing in the text editor. In the documentation it says that passing a ' X' to him in the field scrollend of the parameter Control is obtained that operation. Nevertheless, I did this and the cursor continues appearing at the beginning of the text that visualizes.
    Somebody could help me please?
    Regards,
    Gabriel
    PD: The code that I use is the following one:
    FORM f_ingresar_comentarios.
    DATA: l_action,
    l_result LIKE itcer,
    l_pedido LIKE thead-tdname,
    li_coment_save LIKE i_comentarios OCCURS 0,
    li_coment_aux LIKE i_comentarios OCCURS 0 WITH HEADER LINE,
    l_lines TYPE i,
    l_lines_save TYPE i,
    l_lines_insert TYPE i,
    l_index TYPE i,
    l_index_aux TYPE i,
    l_insert,
    lwa_control LIKE itced.
    CLEAR: l_action.
    CLEAR i_comentarios.
    REFRESH: i_comentarios,
    li_coment_save,
    li_coment_aux.
    l_pedido = v_pedido.
    Leemos el texto si es que existe
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    client = sy-mandt
    id = v_id_text
    language = sy-langu
    name = l_pedido
    object = c_ekko
    IMPORTING
    header = wa_cabecera
    TABLES
    lines = i_comentarios "Lineas de texto leídas
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found = 4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    IF sy-subrc <> 0.
    Armamos la cabecera por primer comentario para el pedido
    CLEAR wa_cabecera.
    wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
    wa_cabecera-tdname = v_pedido. "Nro de pedido
    wa_cabecera-tdid = v_id_text. "ID en tabla TTXID
    wa_cabecera-tdspras = sy-langu. "Lenguaje
    wa_cabecera-tdlinesize = 70.
    ENDIF.
    Salva comentarios originales
    li_coment_save[] = i_comentarios[].
    lwa_control-scrollend = c_x. " c_x = 'X'
    Abre el editor de texto
    CALL FUNCTION 'EDIT_TEXT'
    EXPORTING
    header = wa_cabecera
    save = space
    control = lwa_control
    IMPORTING
    newheader = wa_cabecera
    function = l_action
    RESULT = l_result
    TABLES
    lines = i_comentarios
    EXCEPTIONS
    object = 1
    id = 2
    language = 3
    name = 4
    linesize = 5.
    Si cambio los comentarios, actualiza comentarios
    CASE l_action.
    WHEN c_unchanged.
    WHEN c_delete.
    WHEN c_update OR
    c_insert.
    Obtiene cantidad de lineas de comentarios originales y modificados
    DESCRIBE TABLE li_coment_save LINES l_lines_save.
    DESCRIBE TABLE i_comentarios LINES l_lines.
    Si se insertaron lineas...
    IF l_lines > l_lines_save.
    Calcula cantidad de lineas a insertar para luego calcular valor de
    indice a partir del cual insertar los nuevos comentarios
    l_lines_insert = l_lines - l_lines_save.
    l_index = ( l_lines - l_lines_insert ) + 1.
    Controla que al menos una de las lineas insertadas sea diferente de
    blanco
    l_index_aux = l_lines.
    l_insert = c_n.
    DO l_lines_insert TIMES.
    READ TABLE i_comentarios INDEX l_index_aux.
    IF sy-subrc = 0 AND
    i_comentarios-tdline <> space.
    l_insert = c_s.
    EXIT.
    ENDIF.
    l_index_aux = l_index_aux - 1.
    ENDDO.
    IF l_insert = c_s.
    Carga comentarios originales y agrega lineas insertadas
    li_coment_aux[] = li_coment_save[].
    APPEND LINES OF i_comentarios
    FROM l_index
    TO l_lines
    TO li_coment_aux.
    Setea variable para indicar actualizacion de comentarios.
    v_comentario = 'S'.
    Agrega usuario y fecha del comentario
    CONCATENATE sy-uname
    sy-datum
    INTO li_coment_aux-tdline
    SEPARATED BY space.
    li_coment_aux-tdformat = '*'.
    APPEND li_coment_aux.
    Grabamos el texto
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    client = sy-mandt
    header = wa_cabecera
    savemode_direct = c_x
    IMPORTING
    newheader = wa_cabecera
    TABLES
    lines = li_coment_aux
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    object = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDCASE.
    ENDFORM. " f_ingresar_comentarios
    In addition, I made another program simpler that it uses the same functions and also have the same problem:
    *& Report Y_GVA_TEXT *
    REPORT y_gva_text .
    DATA: wa_cabecera LIKE thead,
    i_comentarios LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA: l_action,
    v_comentario,
    l_result LIKE itcer,
    v_pedido LIKE thead-tdname VALUE '3',
    l_pedido LIKE thead-tdname,
    c_a05 LIKE thead-tdid VALUE 'A05',
    c_ekko LIKE stxh-tdobject VALUE 'EKKO',
    l_lines LIKE sy-tabix,
    lwa_control LIKE itced.
    CONSTANTS: c_x VALUE 'X',
    update VALUE 'U', "Langtext verändert
    insert VALUE 'I', "Langtext eingefügt
    delete VALUE 'D', "Langtext gelöscht
    modify VALUE 'M', "Kein Langtext, Inlinezeile veränd.
    unchanged VALUE ' '.
    CLEAR: l_action.
    CLEAR i_comentarios.
    REFRESH i_comentarios.
    Leemos el texto si es que existe
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    client = sy-mandt
    id = c_a05
    language = sy-langu
    name = v_pedido
    object = c_ekko
    IMPORTING
    header = wa_cabecera
    TABLES
    lines = i_comentarios "Lineas de texto leídas
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found = 4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    Armamos las cabecera para mostrar los comentarios
    CLEAR wa_cabecera.
    wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
    wa_cabecera-tdname = v_pedido. "Nro de pedido
    wa_cabecera-tdid = c_a05. "ID en tabla TTXID
    wa_cabecera-tdspras = sy-langu. "Lenguaje
    wa_cabecera-tdlinesize = 70.
    ENDIF.
    lwa_control-noendlines = c_x.
    lwa_control-scrollend = c_x.
    Abre el editor de texto
    CALL FUNCTION 'EDIT_TEXT'
    EXPORTING
    header = wa_cabecera
    save = space
    control = lwa_control
    IMPORTING
    newheader = wa_cabecera
    function = l_action
    RESULT = l_result
    TABLES
    lines = i_comentarios
    EXCEPTIONS
    object = 1
    id = 2
    language = 3
    name = 4
    linesize = 5.
    Si cambio los comentarios, actualiza comentarios
    CASE l_action.
    WHEN unchanged.
    WHEN delete.
    WHEN update OR
    insert.
    Agrega usuario y fecha del comentario
    CONCATENATE sy-uname
    sy-datum
    INTO i_comentarios-tdline
    SEPARATED BY space.
    i_comentarios-tdformat = '*'.
    APPEND i_comentarios.
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    header = wa_cabecera
    IMPORTING
    newheader = wa_cabecera
    TABLES
    lines = i_comentarios.
    ENDCASE.

    Murugesh,
    I believe that you have mis-read Gabriel's problem.
    Gabriel,
    The cursor is not positioning at the base of the editor as you have cited.
    In order to get this functionality to work, you must set the LINE_EDITOR import paramter to 'X'.
    data: hdr like THEAD.
    data: l_itced like itced.
      hdr-tdobject = 'VBBP'.
      hdr-tdname = '4000029521000030'.
      hdr-tdid = 'Z005'.
      hdr-tdspras = 'E'.
      hdr-TDLINESIZE = '100'.
      hdr-TDTXTLINES = '3'.
      l_itced-SCROLLEND = 'X'.
      CALL FUNCTION 'EDIT_TEXT'
        EXPORTING
        DISPLAY             = ' '
        EDITOR_TITLE        = ' '
          HEADER              = hdr
        PAGE                = ' '
        WINDOW              = ' '
        SAVE                = 'X'
          LINE_EDITOR         = 'X'   " here !!!
          CONTROL             = l_itced
        PROGRAM             = ' '
        LOCAL_CAT           = ' '
      IMPORTING
        FUNCTION            =
        NEWHEADER           =
        RESULT              =
        TABLES
          LINES               = lines
      EXCEPTIONS
        ID                  = 1
        LANGUAGE            = 2
        LINESIZE            = 3
        NAME                = 4
        OBJECT              = 5
        TEXTFORMAT          = 6
        COMMUNICATION       = 7
        OTHERS              = 8
    Don't forget those points !!

  • How to position the cursor in a text

    I there a better way to position the cursor in a text portion other than trying it several times until the OS picks the right space? I know the iPad has a good way to do it by zooming in.
    Or is RIM working on it.....

    I've been pretty successful at getting the cursor to hit where I want in text entry boxes.
    Maybe some more practice will make perfect. Worked for me, until I got used to,and then again maybe my using a touchscreen smartphone, the process just comes second nature for me.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Reading from a file. How to ask the user for file name at run time????

    I have the code to read from a file but my problem is how to prompt the user for the file name at run time.
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.InputMismatchException;
    import java.util.Scanner;
    public class FileRead {
        public static void main(String args[]) {
            Scanner scan = null;
            File file = new File("Results.txt");
            String number;
            try {
                scan = new Scanner(file);
                while (scan.hasNext()){
                number = scan.next();
                System.out.println(number);}
            catch (FileNotFoundException ex1){
                System.out.println("No such file");
            catch (IllegalStateException ex2){
                System.out.println("Did you close the read by mistake");
            catch (InputMismatchException ex){
                System.out.println("File structure incorrect");
            finally{
                scan.close();}
    }Any hints would be greatly appreciated. Thank you in advance

    I have read through some of the tutorials that you have directed me too and they are very useful, thank you. however there are still a few things that i am not clear about. I am using net beans 5.0 I have placed a text file named Results.txt into the project at the root so the program can view it.
    When I use the code that you provided me with, does it matter where the file is, or will it look through everywhere on the hard drive to find a match?
    This code compiles but at run time it comes up with this error
    run-single:
    java.lang.NoClassDefFoundError: NamedFile
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 3 seconds)
    import java.util.Scanner;
    import java.io.*;
    class NamedFileInput
      public static void main (String[] args) throws IOException
        int num, square;   
        // this Scanner is used to read what the user enters
        Scanner user = new Scanner( System.in );
        String  fileName;
        System.out.print("File Name: ");
        fileName = user.nextLine().trim();
        File file = new File( fileName );     // create a File object
        // this Scanner is used to read from the file
        Scanner scan = new Scanner( file );     
        while( scan.hasNextInt() )   // is there more data to process?
          num = scan.nextInt();
          square = num * num ;     
          System.out.println("The square of " + num + " is " + square);
    }his is the code that i used. It is the same as the code you posted for me (on chapter 23 I/O using Scanner and PrintStream) Sorry im just really stuck on this!!

  • How to get the read input file name in bpel process using File Adapter.

    Hi,
    I am reading a .txt file from configured directory using File Adapter.
    I had configured file adapter to read file with naming pattern “SalesOrder.*\.txt”.
    Now I had requirement to access the actual file name in bpel process eg: “SalesOrder123.txt”
    How can I get the file name in bpel process.
    Any help is appreciated.
    Vidya.

    1) create a variable of message type. Click on Browse Message type. Here you select Message Type-->Project WSDL Files -->fileAdapterInboundHeader-->Message Types-->Inboundheader_msg. Then click OK
    2)Next dbl Click on teh receive Activity which is receing your File from teh File Adapter. Go to the Adapter Tab. Click on Browse variable and select the variable that you had just created above.
    This would get the File name in the variable declared

  • How to position the cursor

    I am working with a application well knon gestion software and in my form I want that the cursor is positioned in a textfield into the form . I don't know how I can do this In my case is very important for that the user feel easy use .
    Thanks
    Miguel Manzano

    I've been pretty successful at getting the cursor to hit where I want in text entry boxes.
    Maybe some more practice will make perfect. Worked for me, until I got used to,and then again maybe my using a touchscreen smartphone, the process just comes second nature for me.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to increase the length of file name of the attachment?

    hi experts,
    i'm using cl_document_bcs->add_attachment to add the PDF file into the email. here, the file name is imported from i_attachment_subject which has a maximum length of 50.
    now my requirement is that increase the file name up to 128 characters. kindly give me some clues, please.
    Thanks in advance.

    Hi,
    Try using below:
    Class          : cl_bcs (Business Communication Service)
    Method    : set_message_subject
    Thanks,
    Venkatesh

  • How to get the active document file name using illustrator CS2 plugin code?

    I wanna take file name from active document using illustrator plugin CS2. Plz anybody help me..
    Thanks in advance..

    AIDocumentSuite::GetDocumentFileSpecification() should get you that information. Note that it will only work properly if you've already saved the document (or opened it from a file). I'm not sure what the result looks like if you're calling that on a new, unsaved file.

  • How position the cursor in selected screen field insted of defualt field

    Hi All,
    Can you pls let me know , how to position the cursor in selected selection-screen filed. My requirement is i have 3 selection-screen fields, By default cursor is positioned on field screen field, but i want the cursor to be positioned at 3rd screen field to enter input, i want to do this coz i am filling first 2 screen fields with default values, so i need to position the cursor at 3 rd screen filed. let me know if it is possible to achieve this.
    Thanks in advance.
    Regards
    Vishal

    You will need to point it to the LOW field.
    report zrich_0001.
    tables: reguh.
    select-options :
    s_bukrs for REGUH-ZBUKR default 'US10',
    s_laufd for REGUH-LAUFD default sy-datum,
    S_LAUFI FOR REGUH-LAUFI .
    at selection-screen output.
    <b>set cursor field 'S_LAUFI-LOW'.</b>
    Welcome to SDN!  PLease be sure to award points for helpful answer and mark you post as solved when solved completely.  Thanks.
    Regards,
    Rich Heilman

  • How to get the Attributes of file ?

    Hi Guru,
    How to find of the Attributes of file in sap u2018 AL11u2019.
    The file attribute details need to show in the report.
    If any idea plz. Help me.
    Regards,
    Subash

    The attributes you can see from , go tofile part level in the directory. Place the cursor on file name and choose menu option
    Log file ->attributes.
    Edited by: Raja gurrala on Jul 31, 2009 1:16 PM

  • To position the cursor

    How to position the cursor at next item if i choose kod_kat_pkj = '2' then the cursor will go(jump to) to kod_ngra ( state)
    Begin
    --Job categories
         begin
              select initcap(nama)
              into :lmd_pmk_pkj.kod_kat_pkjn_d
              from lmd_ref_kat_kerja
              where kod = :lmd_pmk_pkj.kod_kat_pkjn;
         exception
              when no_data_found then
                   :lmd_pmk_pkj.kod_kat_pkjn_d := '-Tiada-';
         end;
    --Worker Categories
         begin
              select initcap(nama)
              into :lmd_pmk_pkj.kod_kat_pkj_d
              from lmd_ref_kat_pkj
              where kod = :lmd_pmk_pkj.kod_kat_pkj;
         exception
              when no_data_found then
                   :lmd_pmk_pkj.kod_kat_pkj_d := '-Tiada-';
         end;
    --State if imigran
         if :lmd_pmk_pkj.kod_kat_pkj = '3' then
              begin
                   select initcap(nama)
                   into :lmd_pmk_pkj.kod_ngri_d
                   from lmd_ref_ngri
                   where kod = :lmd_pmk_pkj.kod_ngri;
              exception
                   when no_data_found then
                        :lmd_pmk_pkj.kod_ngri_d := '-Tiada-';
              end;
         end if;
    --State
         if :lmd_pmk_pkj.kod_kat_pkj = '2' then
              begin
                   select initcap(nama)
                   into :lmd_pmk_pkj.kod_ngra_d
                   from lmd_ref_ngra
                   where kod = :lmd_pmk_pkj.kod_ngra;
              exception
                   when no_data_found then
                        :lmd_pmk_pkj.kod_ngra_d := '-Tiada-';
              end;
         end if;
    exception
         when others then
         call_alert('e_alt01','POST_QUERY LMD_PMK_PKJ : '||dbms_error_text);
    End;

    Post-Text-Item
    if :lmd_pmk_pkj.kod_kat_pkj = '2' then
         go_item('lmd_pmk_pkj.kod_ngra');
    elsif :lmd_pmk_pkj.kod_kat_pkj = '3' then
         go_item('lmd_pmk_pkj.kod_ngri');
    else     
         go_item('lmd_pmk_pkj.bil_pkj_l');
    end if;     
    But why when i choose 2, the cursor not jump to next item kod_ngra.

  • Is there any meaning to the iMovie .mov file names?

    I went into iMovie Events folder and looked at the a specific event folder.
    A sample of the imported video file names are as follows -
    clip-2007-12-01 14;51;04.mov
    clip-2007-12-01 15;32;09.mov
    clip-2007-12-01 17;00;33.mov
    clip-2007-12-01 17;19;44.mov
    How does iMac name the video files? Is there some kind of logic to the naming of the videos that I am not aware of?
    The first file (clip-2007-12-01 14;51;04.mov) is a 2s video and the second (clip-2007-12-01 15;32;09.mov)is a 13s video.

    How does iMac name the video files? Is there some kind of logic to the naming of the videos that I am not aware of?
    To add a bit to what Winston has already said... Files imported via the "Import from Camera..." option are typically files captured from a camcorder or a device which iMovie '08 considers to be a camcorder. Thus the prefix "Clip-". Theoretically, the "2007-12-01 14;51;04" represents the date time group when the files was imported or the "time stamp" from the recording device which may or may bear any resemblance to a factual time. And as was previously pointed out, the ".mov" is a standard extension signifying the file container type. Therefore "clip-2007-12-01 14;51;04.mov" is a file clip imported or created on the 1st of December in 2007 at 2:51:04 PM and placed in an MOV (generic) file container.
    With regard to the file container itself, this is determined by the method of import. Files imported at the "Finder" level are imported with their original "Finder" name and in the same file container as the original file. Camcorder files, on the other hand fall into two separate classes -- those requiring some sort of conversion and those that don't. An standard definition DV file is imported in its original DV container since it does not require any conversion. Files encapsulated in MPEG (like HDV, AVCHD, or MPEG-2), however, need to transformed to make them "edit" compatible with iMovie '08. At the very least, the audio is demuxed to "elementary" AIFF file(s) resampled to 48.0 KHz with 16-bit sampling and is now in a "temporal" compression format. In the case of HDV and AVCHD, the video is extracted/converted and can then be merged/synchronized with the audio and saved. This merging and saving of diverse content is what produces the MOV file container in the same manner as using the "Save As..." file command in QT Pro. HDD SD content however must undergo additional processing. Since the 'muxed" MPEG2/AC3 content does not share a common time reference, a "time" track is added to the container for audio time reference and to reduce/minimize drifting between audio and video tracks, the modified MPEG-2 video (now essentially having been turned into an Motion-JPEG video) is provided with an internal track start and/or end time offset and the whole saved in the generic MOV file container.

  • How to change the default password file's name and path when the database created?

    how to change the default password file's name and path when the database created?
    null

    Usage: orapwd file=<fname> password=<password> entries=<users>
    where
    file - name of password file (mand),
    password - password for SYS and INTERNAL (mand),
    entries - maximum number of distinct DBA and OPERs (opt),
    There are no spaces around the equal-to (=) character.

Maybe you are looking for