Why my textfield can not get focus?

I put a textfield on the first tab of a tabbed panel. I need this textfield to get the focus when I open the first tab. I tried to use grabfocus() method in the constructor of class, but it does not work. Does anybody know why? and how can I solve it?
Thanks!

No, I didn't call grab/requestFocus on the event thread.
My code is like this:
public class GeneralPane extends JPanel {
JPanel ltPane;
private JTextField txtCountry;
public GeneralPane() {
initComponents();
private void initComponents(){
setLayout(new BorderLayout());
//Add another Panel to contain Labels and Text fileds
ltPane = new JPanel();
FocusListener mFL = new FL();
txtCountry = new JTextField("US", 20);
//this listener is used to store the data in the textfield into a variable
txtCountry.addFocusListener(mFL);
// add the textfield into ltPane
mUtil.insertTextPane(txtCountry,ltPane);
//txtCountry got focus
//txtCountry.setFocusable(true);
ltPane.requestFocus();
//txtCountry.requestFocusInWindow();
Then in the main program, I create an instance of this class and then use addTab(...) function into the my tabbedPanel.
The logic is simple, but the textfield still couldn't get focus when I open the tabbedPanel.

Similar Messages

  • Why my function can not get proper varaible value

    Hi.
    I write a MXML file like this.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    invoke="setint()"
    creationComplete="getint()">
    <mx:Script>
    <![CDATA[
    import mx.utils.StringUtil;
    import mx.controls.Alert;
    public var number:int = 100;
    private function setint():void{
    number = 200;
    Alert.show("" + number);
    private function getint():void{
    Alert.show("" + number);
    ]]>
    </mx:Script>
    </mx:WindowedApplication>
    I define a varaible in ActionScrip. one function is to set
    its value, another is to get its value. why function getint()
    always get value 100. this varaible can not be set. the two
    function are trigger in invoke event and creationComplete.

    "crystalChen" <[email protected]> wrote in
    message
    news:ghska7$31a$[email protected]..
    > Hi.
    > I write a MXML file like this.
    > <?xml version="1.0" encoding="utf-8"?>
    > <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > invoke="setint()"
    > creationComplete="getint()">
    >
    > <mx:Script>
    > <![CDATA[
    > import mx.utils.StringUtil;
    > import mx.controls.Alert;
    >
    > public var number:int = 100;
    > private function setint():void{
    > number = 200;
    > Alert.show("" + number);
    > }
    >
    > private function getint():void{
    > Alert.show("" + number);
    > }
    > ]]>
    > </mx:Script>
    >
    > </mx:WindowedApplication>
    >
    > I define a varaible in ActionScrip. one function is to
    set its value,
    > another
    > is to get its value. why function getint() always get
    value 100. this
    > varaible
    > can not be set. the two function are trigger in invoke
    event and
    > creationComplete.
    Check out "Defining Public properties by using getter and
    setter methods"
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=ascomponents_3.html

  • Why the 2LIS_08TRTK extractor can not get  all data

    Hello, BW Gurus.
    Why the 2LIS_08TRTK and 2LIS_08TRTLP extractors can not get all data. I had used the RSA3 and get 10 registers, when a check at the VTTK table I had 20 registers, I didnt use filters at RSA3, could you help to know what happen o correct it.

    Is it because
    <i>
    Shipment documents and their dependent objects (shipment stages as well as shipment items [deliveries in the shipment]) are only extracted into BW when the Shipment completion status has been set.
    This is necessary because the numeric values that result from the delivery documents are only established at the time. If the data were already stored earlier in BW, the shipment data would not be updated if the delivery notes were changed in BW.
    </i>
    - from oss note 573470.

  • HT1454 why i can not get video out from my ipod touch after i did the upgrade

    why i can not get video out from my ipod touch after i did the upgrade

    why i can not get video out from my ipod touch after i did the upgrade

  • I have Firefox 6.0 running under Windows XL. When I forward an email with a URL in it, my recipients tell me the URL is not highlighted and they have to cut and paste it into their browser. Why? How can I get my forwarded URLs to be highlighted?

    I have Firefox 6.0 running under Windows XL. When I forward an email with a URL in it, my recipients tell me the URL is not highlighted and they have to cut and paste it into their browser. Why? How can I get my forwarded URLs to be highlighted?

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Why I can not get the medium crate of gold

    I need to ask why I buy medium crate of gold in the contract killer : zombies 2 I can not get it can help me check what happen

    What happens when you try to buy it ? If you are getting a message to contact iTunes support then you can do so via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then try selecting Purchases, Billing & Redemption

  • I am having same problem with apple tv need 4.4 version and can not find solution this a brand new product out of box yesterday why would it not already have updated version. I am getting frustrated that I can not get this mirroring icon to work. I

    I am having same problem with apple tv need 4.4 version and can not find solution this a brand new product out of box yesterday why would it not already have updated version. I am getting frustrated that I can not get this mirroring icon to work. I have tried all suggestions in this thread and nothing works. I also hooked up to laptop through iTunes with micro USB nothing!!!

    The new appletv software came out 2 or 3 days ago, how would Apple get it on the device in the box in a store?
    Why don't ou update the appletv software?

  • How to make a JScrollPane not getting Focus?

    How to make a JScrollPane not getting Focus?
    When i tab out from a textfield inside a scroll pane focus is going to ScrollPane .And if i press tab once more then only focus is going to other textField which is outside the scrollpane.
    For me when i press tab from a text field inside a scrollPane ,i should go to textfield out side the scroll pane.
    satish

    Hi,
    I've the same problem, that I have to double click on tab
    to step from a textfield with a scrollpane to the next textfield in my panel.
    I tried to implement a FocusListener on my JScrollPane, but without success.
    Can you tell me in detail how to implement this listener ?
    Kind regards
    Andy Kanzlers

  • Can not get data from database

    hi all,
        there is a problem ,  when i write like below :
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
              WHERE bukrs = p_bukrs
                AND hkont = p_hkont.
    p_bukrs , p_hkont are all on the selection screen , and p_bukrs = 1200 another is eq blank. i can not find any data , but with the same condition i can find some data in database , when i debeg i found that p_hkont is initial.
        when i write like this :
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
              WHERE bukrs = p_bukrs .
    this time i can find the data like the database.
        so , does someone know where the problem is , why i can not get data ?
    kind regards
    kevin

    hi,
    if u r  using bukrs and hkont as parameters in selection screen then
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
    WHERE bukrs = p_bukrs
    AND hkont = p_hkont.
    this will work.
    if u r using then as select-option then the above does n't work.
    bcoz select-options work as internal table bcoz of that u have use the query like this
    SELECT * FROM bsis INTO CORRESPONDING FIELDS OF TABLE it_temp
    WHERE bukrs IN p_bukrs
    AND hkont IN p_hkont.
    <REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
    Edited by: Alvaro Tejada Galindo on Aug 15, 2008 5:25 PM

  • Please I can not get a .jar file to run on XP SP3 start/run/cmd/

    I can not get a .jar file to run on XP SP3 start/run/cmd/
    Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
    I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
    I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
    I'm trying to run this jar file (soht-client-0.6.2.jar):
    http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
    http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
    (yes the file can be executed and should open the program's window
    I wanted to post screenshot of it but friend that it's working for isn't here)
    _(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
    _I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
    ++I then start/open/run/cmd+
    then I: cd C:\062\+
    then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
    java -jar soht-client-0.6.2.jar
    java -jar -client soht-client-0.6.2.jar
    java -client -jar soht-client-0.6.2.jar
    java -jar soht-client-0.6.2.jar soht.properties
    soht-client-0.6.2.jar
    So I try this cmd: java soht-client-0.6.2.jar
    Reply:
    C:\062>java soht-client-0.6.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
    Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: soht-client-0.6.2.jar. Program will exit.
    I try this cmd:
    java -jar soht-client-0.6.2.jar -client
    Reply:
    C:\062>java -jar soht-client-0.6.2.jar -client
    Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
    ent (The system cannot find the file specified)
    SOHT Java Client
    The SOHT Java Client requires a properties file. Either start
    the application in the same directory as the soht.properties
    file, or specify the file name on the command line:
    java -jar soht-cleint-<version>.jar c:\soht.properties
    So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
    j_ava -jar soht-client-0.6.2.jar -client soht.properties_
    java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
    So then I copy soht.properties to C root and do:
    java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
    Then from other information I have read I right click on the .jar file, select open with Always open with:
    _"C:\Program Files\Java\jre6\bin\javaw.exe"_
    Try again.. same problem.
    Then I do cmd:
    _"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
    does nothing, retry the other commands same thing (either nothing or those same replies)
    Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
    So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
    C:\062>java -jar soht-client-0.6.2.jar
    'java' is not recognized as an internal or external command, operable program or batch file.
    Then I install  Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
    go to test java page; all is good, run cmds again -and still nothing..
    C:\062>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
    I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
    same thing.. nothing
    Thank you very much for your time :D_
    PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.

    Thank you very much for your replies Taggert_77 & swmtgoet_x :D
    Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
    Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
    This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
    swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
    The proper cmd is simply: java -jar soht-client-0.6.2.jar
    I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
    java -client -jar soht-client-0.6.2.jar soht.properties
    Thank you again...the mystery remains
    PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above).

  • I can not get LabVIEW to respond to a VB6 ActiveX event

    I am working with a VB6 ActiveX dll (VBtablet.dll is a wrapper for Wintab32 for a tablet interface) using LV8.2.1 and can not get it to respond to an event.  I have opend the object and registered it for callback, but have had no luck in having an event generated.  Is there anyway to see these events generated or at least that it has been registered?  The dll has no problem working in a VB app or in Excel using a VB macro.  Is there anything special that has to be in the ActiveX object to get LabVIEW to respond to it?
    When I register the callback I use a control reference of the data being returned as my "user data" and in the callback VI I wire the event data into the "Value" of the control reference. I believe this is all I have to do.  Any ideas would be helpfull.
    Thanks,
    Paul 

    cueball wrote:
    I am able to see that events are generated from the dll, but somewhere between the ActiveX object and LabVIEW it is disconnected.  Is it possible that LabVIEW is excepting these events and not allowing then into the code.  The path as I see it is
    dll -> WinAPI -> ActiveX -> LabVIEW
    One thing this dll requires is a windows handle and I am wondering if LabVIEW itself is reads the events directly instead of ignoring them.  The reason I bring it up is that the tablet works like a mouse and I am wondering if it is absorbing these commands directly and not allowing them to be passed through the ActiveX object. Like this
    dll-> WinAPI -> LabVIEW
    therefore the event is never generated.  That is why I wish I could speak with someone at NI that could explain that process better, but it seems like there is no one at NI who knows any high level issues.
    First this are not high level issues but lowest low level issues. Some of it certainly is more Windows related than LabVIEW so support from MS, as unlikely it is to get that, would be at its place. NI people are not there nor can't really help you debug your VB issues.
    Second you say it is a tablet and works like a mouse, then I'm wondering if Windows is not simply claiming it as a Human Interface Device itself and not really letting you control it yourself in your VB control.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can not get wiki to work

    Hey there,
    I have been trying to set up Leopard server for over a week. I can not get DNS, Open Directory and Wiki to work for me. This is my 5th instal. The first attempt, I went with standard thinking that the ease of use would be an asset, but then after getting it going I realized that there was no FTP access with standard, which was not an option.
    INSTAL 2: I reformatted and went ahead with the advanced server this time around. In no time I had FTP; AFP; iChat and web services running fine. Then when I went to set up wiki i realized that I had to have DNS and Open Directory running before that would work. I guess that I should of read up on that one... I had actually created all of my users and groups in local directory which seemed to work fine for ftp; afp and ichat for a few days but I really wanted to get the wiki going.
    INSTAL 3: I reformatted, set up DNS (or at least I thought I did) Open Directory and then recreated all of my users and groups in Open directory. I quickly got afp running; then ftp and ichat (jabber) with no issues. But when I went ahead with wiki, I could not get it to work properly. I could log into the wiki from my LAN using the local domain name that I had chosen but could not get it to work when I would attempt to do it from home using my dyndns.org account which forwards to my office IP which is mapped through router port 80 to my servers local IP. When doing this I was taken to: http://myurl.dyndns.org/groups/workgroup/
    I got the message:
    "Not Found
    404: No group with that name (workgroup) hosted on this server"
    If I click on "Groups" the error goes away and I see my wiki group but if I clicked on it I would get:
    "Not Found
    404: No group with that name (marcato) hosted on this server"
    When I went back to the office I could still get at my wiki by going to my local url: minserver.local and then selecting groups and then clicking on the desired wiki and then logging in. I then tried to accessing it using the machine's local IP since that is essentially what is happening when I come in from the WAN side using my dyndns.org account. So i typed in its local address and got the 404 error. When I click on groups again, just like when I was home coming in over the WAN, I get the same message. Why would I be seeing the group but not able to log in to it. Why would it allow me to access and use the Wiki from the LAN using miniserver.local but not using the machine's static Local IP address?
    I then decided to go watch all of Sean Collin's videos on Leopard Server in oder to get a handle on this.
    INSTAL 4: Walked through everything with Sean's video up to getting DNS set up. It failed! At this point I was frustrated so I decided to throw in the towel on Advanced. I got out my old tiger installer and set up ftp on another older G4 and then went for INSTAL 5. This time I reverted back to Standard, got all of the services running fine but as soon as I got home I ran into the same issue with the wiki. I could not access it from outside of the Office LAN. I went through and opened every port recommended and still nothing. Then, in efforts to try to make it work and in frustration of the limitations of the Standard interface I upgraded the configuration from standard to advanced to see if I could get to the bottom of this. I went back to reading a bunch more stuff about Mac Server and found the Sudo Changeip -checkhostname. It gave me the proper IP of the server as well as the proper hostname but said that the DNS was not working properly and needed to be repaired. I tried a few hacks I found online but still could not get the DNS going properly
    I am not sure what to do now. In an ideal world I would love to get leopard Advanced running properly so that I could host the wiki, afp, ftp, and ichat (jabber) from the same machine. But no matter what I try I can not seem to wrap my head around DNS. Even if I could do it with Standard and keep the ftp on the old mac with tiger... This is frustrating since I feel really confident with setting up everything else, I just do not seem to be able to get DNS to work properly which I assume has to do with the problem with the wiki not working from the WAN.
    Can someone please help me here?

    I have tried a bunch of hacks to try to get things working and still nothing. I actually find that the server is running really slow now so I am clearly going to be starting from skratch again. I will wait for some advice before I proceed. Here is what I have set up:
    1. I made a fake url using dyndns which routes to the IP address of the router at work. I want to be able to use this address to access the wiki from WAN
    2. I have the following ports opened and assigned to my servers LAN address:
    On TCP 113 113 10.0.1.22 Identification Protocol
    On TCP 88 88 10.0.1.22 Kerberos
    On TCP 106 106 10.0.1.22 Mac OS X Server Password Server
    On TCP 25 25 10.0.1.22 Mail service smtp
    On TCP 123 123 10.0.1.22 Network Time Protocol (NTP)
    On Both 311 311 10.0.1.22 Remote Server Admin / Workgroup
    On TCP 22 22 10.0.1.22 SSH
    On Both 3283 3283 10.0.1.22 Server ARD
    On Both 5900 5900 10.0.1.22 Server VNC ARD
    On UDP 500 500 10.0.1.22 VPN
    On UDP 1701 1701 10.0.1.22 VPN
    On TCP 1723 1723 10.0.1.22 VPN
    On UDP 4500 4500 10.0.1.22 VPN
    On UDP 170 170 10.0.1.22 VPN L2TP
    On Both 80 80 10.0.1.22 Web Server on Mini
    On TCP 625 625 10.0.1.22 Workgroup Manager
    On TCP 21 21 10.0.1.22 ftp
    On Both 8443 8443 10.0.1.22 iCal SSL
    On Both 8008 8008 10.0.1.22 ical server
    On TCP 5190 5190 10.0.1.22 ichat Server
    On TCP 5220 5220 10.0.1.22 ichat Server
    On TCP 5222 5222 10.0.1.22 ichat Server
    On TCP 5223 5223 10.0.1.22 ichat Server
    On TCP 5298 5298 10.0.1.22 ichat Server
    On UDP 5190 5190 10.0.1.22 ichat Server
    On UDP 5297 5297 10.0.1.22 ichat Server
    On UDP 5298 5298 10.0.1.22 ichat Server
    On UDP 5353 5353 10.0.1.22 ichat Server
    On UDP 5678 5678 10.0.1.22 ichat Server
    On UDP 16384-16403 10.0.1.22 ichat Server
    On Both 7777 7777 10.0.1.22 ichat Server file
    On TCP 5269 5269 10.0.1.22 ichat Server to Server
    On Both 5109 5109 10.0.1.22 istat for mini server
    On Both 16563 16563 10.0.1.119 pc
    On Both 8086 8086 10.0.1.22 wiki server
    On Both 8010 8010 10.0.1.22
    3. I am not sure what is meant exactly by a fully qualified domain. From what I understood in Sean's Collin's videos was that this was a url that I was to make up on my local network and that putting the . at the end made it FQDN. I choose: miniserver.local. Am I totally missing the mark here?
    Here are the parts of the set up where I am really confused:
    a. When setting up the server with Server Assistant, when it asks for Primary DNS and computer name. What am I supposed to put in here? I read one post that recommended that quiting the set-up assistant before this point and doing it manually?
    b. Once I get through the assistant and launch Server Admin, and sign into it using the servers local IP, get into DNS and go to add zones, I am REALLY CONFUSED.
    - I add my primary zone, What is the primary zone? What do I enter here? What about the name server? I do not understand the difference between these 2 things.
    c. Then I go to add my A record for the machine. What should its Machine name be? the same as the primary zone?
    What is the easiest way to get through this? I know that once I this is set up and I can get the wiki to work over the WAN that I am not going to have any problems with the rest. I don't even want to bind the computers to the server if I don't have to. I know that for ichat (jabber); afp and ftp that this is not required since every time I have attempted to get the server up these services worked every time without the binding.

  • I need to get into my old account and get my addresses and then cancel the old account but can not get into it. Had to change my user name when I moved and now I can't get into Firefox. Can't remember the old password. What to do??

    I moved during the summer. I changed to highspeedand & when I set my computer up it told me that my email address was already in use so I had to change it(????) I changed from jkady to [email protected] I tried to change it on firefox but it would not except the new name and I could not get into my old account.I need all my addresses and would like to cancel the old account but I can not get into it. This is very frustrating!!!!! I need my addresses!!!!!!!!

    I logged in changed the primary E-Mail address to a different one, vertified it then tried to log in it said either to send an E-Mail to veritify again or to do my security questions, so I choose to do the security questions and put in my Birthday like it asked and it said that it was wrong and I had to authenticate it to get in, why is it so hard to just set up a Apple ID really though!
    So I tried the E-Mail to and it has not sent me an E-Mail then I tried to log in again and it has locked me out of my account so I try to recover my password and it gave me the same options to get my password back and both options are doing the same as before, it says I don't know my on birth date or it is wrong or needs authenticate it, then the E-Mail doesn't come through!
    This is just stupid now.

  • My Firefox menu button has disappeared. Why? How can I get it back? Without it I don't know how to get to my FTP.

    My Firefox menu button has disappeared. Why? How can I get it back? Without it I don't know how to get to my FTP. I never did anything to make this happen.

    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.

  • After moving from my home country (Poland) to the Middle East (UAE) with the same computer I can not get connected to Apple Store and iTunes Store.

    After moving from my home country (Poland) to the Middle East (UAE) with the same computer I can not get connected to Apple Store and iTunes Store. Any clue why?
    Regards,
    Maciek

    Click the round flag icon bottom right corner of the App Store window.

Maybe you are looking for