Cursor at certain component

Hello, there:
In a dialog box, I have a dropdown list on the top, followed by three vertically layed out JTextArea components. The cursor defaults to the dropdown list but I'd like to position it on the first TextArea.
I did some search and found I could use requestFocusInWindow(). While it works, it seems that this statement should be in between the dialog being realized and becomes visible, meaning the code should look like:
pack();
com.requestFocusInWindow();
setVisible(true);
However, since pack() will shrink the size of the dialog box,I don't want to use it. In this case, how can I still work with requestFocusInWindow? Or another alternative?
Thanks,
Swayh

setVisible(true);
com.requestFocusInWindow();

Similar Messages

  • Set cursor to a component

    hi, i am just wondering if anyone can tell me how can i actually place a cursor onto a certain component!
    thx in advance!

    You mean like cause the cursor to move to a specific spot on the screen? Or change the cursor icon when it isover a certain component. Either can be done, the first with the java.awt.Robot class and the second by just calling setCursor( Cursor ) on a component.

  • What happens if you perform certain component update for iphoto '11 on mac twice?

    Hi i know it sounds ridiculous and silly question to begin with, maybe i'm just being a little paranoid the thing is that i have update a certain component update for iphoto '11 twice which is "digital raw compatibility update 4.0.3" via automatic app store update on mac and manually via apple support update; the question is that will it replace the update that has been installed earlier on via automatic app store update with the one i have just installed manually via apple support site?, will it take an extra disk space or just rewrite itself cause i don't want to have a dupe update on my mac? and finally will it affect future updates for that particular component? (such as not being detected on app store automatically if new version has arrive?)
    Thanks guys in advance 

    Welcome to the Apple Support Communities
    Probably the version downloaded from Apple Support has overwritten the App Store version, although it's strange that the computer has allowed you to install the same update twice. Apart from this, you won't have any problem in the future and probably it hasn't taken more space of the hard drive

  • How to set cursor in a component by default

    Hi all,
    Does anybody know how to set the cursor inside a textArea? or at any particular component of a frame?
    Thanks in advance.

    textAreaObj.requestFocus() doesn't do it?
    If that doesn't do it, then try textAreaObj.setSelectionStart(0).
    You may have to force a repaint(), possibly, as well.

  • Could someone please tell me how to stop getting 3 cursors for certain tools

    When I have a file open in CS3 running on Win7 64bit and select certain tools such as the crop, paint bucket, eyedropper, and path selection tool it shows up on my screen as three cursors.  I've looked through preferences and searched the net and also mouse properties in control panel to no avail.   On my Win XP computer I get a single cursor when working with these same tools.

    Hello,
    To find the correct solution to your problem, we need some more non-personal information from you. Please do the following:
    # Use ONE of these methods to open the Firefox Troubleshooting Information page:
    #* Click the menu button [[Image:New Fx Menu]], click on help [[Image:Help-29]] and select ''Troubleshooting Information''.
    #* Type '''about:support''' into the Firefox address bar and press the enter key.
    # At the top of the Troubleshooting Information page that comes up, you should see a button that says "Copy text to clipboard". Click it.
    #Now, go back to your forum post, right-click in the reply box and select '''Paste''' from the context menu (or else click inside the reply box and press the Ctrl+V keys) to paste all the information you copied into the forum post.
    If you need further information about the Troubleshooting information page, please read the article [[Use the Troubleshooting Information page to help fix Firefox issues]].
    Thanks in advance for your help!

  • Place the cursor in certain indicator

    Hello all,
    I want to ask whether anyone of you knows how to place the cursor of the mouse in certain indicator automatically when the program starts so that when I read, in my case 2D Barcode, it must be displayed in this certain indicator automatically.
    Thank you in advance,
    I G. 
    Solved!
    Go to Solution.

    Solved. I was using an indicator instead of control.
    Thanks!
    And that doesnt mean you can mark this as accepted solution.
    (Just kidding  )

  • Need to contain cursor within certain dimensions on stage

    Hi, I am using a magify glass as the mouse cursor but I need it to stop before it reaches the edge of my stage.
    someone kindly gave me the following code to put on the main timeline to make the glass move, and stop when an extrnal swf was loaded:
    var moveGlass:Number;
    magnifyingGlass.onPress = function() {
        moveGlass = setInterval(startGlass,1);
    function startGlass() {
        magnifyingGlass._x = _root._xmouse;
        magnifyingGlass._y = _root._ymouse;
    magnifyingGlass.onEnterFrame = function(){
         this.largeobject._x = (this._parent.original._x-this._x)*2;
         this.largeobject._y = (this._parent.original._y-this._y)*2;
    I previously had code which worked at stopping the glass from moving past certian points on the stage but it was on the actual magnify glass movie clip, and it didn't stop moving when an external swf was loaded so I ditched it.
    onClipEvent (mouseDown) {
         startDrag("", true, 125, 127, 1095, 775);
    onClipEvent (enterFrame) {
         setProperty(largeobject, _x, (getProperty(_parent.original, _x)-_x)*2);
         setProperty(largeobject, _y, (getProperty(_parent.original, _y)-_y)*2);
    on (release) {
    If anyone could help that would be much appreciated...you can see the problem at www.zoeglazebrook.co.uk and if you move the cursor to the very right or left of the page. Thanks!

    if I take out the code that person gave me on the forum, and put back 
    this code I found on a tutorial, onto he magnify glass movie clip, 
    then everything works, except the closeBtn on the loaded external swf 
    doesn't?
    On magnify Glass movie clip I have then:
    onClipEvent (mouseDown) {
         startDrag("", true, 125, 127, 1095, 775);
    onClipEvent (enterFrame) {
         setProperty(largeobject, x, (getProperty(parent.original, x)-x)*2);
         setProperty(largeobject, y, (getProperty(parent.original, y)-y)*2);
    on (release) {
    On CloseBtn to unloaded the external swf and the one above it:
    on (release) {
          unloadMovieNum(1);
          _level0.enableBtns();
          level0.magnifyingGlass.visible = true
    on (release) {
          unloadMovieNum(2);
          _level1.enableBtns();
          level0.magnifyingGlass.visible = true

  • Limiting follow cursor to certain area

    I initially posed this question in the general flash forum
    but decided it might be better suited here. I have a navigation
    setup in which I want a bar to follow the cursor when the cursor
    enters the navigation box area itself. (Basically it will follow up
    and down only. My question is- how do I get the bar to not be
    affected (i.e., not move unless the cursor is in the navigation
    area. Right now, the bar follows the mouse up and down whether the
    mouse cursor is in the navigation area or not
    myInterval = setInterval (moveMask,50);
    function moveMask () {
    Bar._y -= (Bar._y-_ymouse)/5;
    if ( Bar._y >=541){Bar._y=541;}
    if ( Bar._y <= 330){Bar._y=330;}
    if ( Bar._x >=627){Bar._x=627;}
    if ( Bar._x <= 451){Bar._x=451;}
    Navigation.setMask(Bar);
    Thanks,
    Dave

    Hey- just an FYI.. I finally got it to work with this cool
    MC_tween extention:
    #include "mc_tween2.as"
    myInterval = setInterval (moveMask,50);
    function moveMask () {
    var home_Y = 126;
    var services_Y = 177;
    var portfolio_Y = 231;
    var contact_Y = 290;
    var mail_Y = 344;
    if(_root._xmouse >= 820 && _root._xmouse <=
    1000 && _root._ymouse >= 110 && _root._ymouse
    <= 140)
    Bar.ySlideTo(home_Y, 1, "easeoutquad");
    if(_root._xmouse >= 820 && _root._xmouse <=
    1000 && _root._ymouse >= 165 && _root._ymouse
    <= 190)
    Bar.ySlideTo(services_Y, 1, "easeoutquad");
    if(_root._xmouse >= 820 && _root._xmouse <=
    1000 && _root._ymouse >= 219 && _root._ymouse
    <= 245)
    Bar.ySlideTo(portfolio_Y, 1, "easeoutquad");
    if(_root._xmouse >= 820 && _root._xmouse <=
    1000 && _root._ymouse >= 279 && _root._ymouse
    <= 300)
    Bar.ySlideTo(contact_Y, 1, "easeoutquad");
    if(_root._xmouse >= 820 && _root._xmouse <=
    1000 && _root._ymouse >= 330 && _root._ymouse
    <= 352)
    Bar.ySlideTo(mail_Y, 1, "easeoutquad");
    Navigation.setMask(Bar);
    Here's the link if anyone is interested:
    http://hosted.zeh.com.br/mctween/

  • Wait cursor shows up as a resize cursor in certain situations

    Strange behavior and my question are below in the comments. I intend to test this program on JRE 1.6 when I get a chance.
    package project2;
    import java.awt.Cursor;
    import java.awt.Dimension;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    // It looks like I found a bug in JRE 1.5
    // The program below shows a main frame in the top left of the screen
    // Press the Dialog button to bring up a dialog box.
    // Upon closing the dialog box,
    // the program will install a wait cursor on the main frame,
    // wait 5 seconds, print some text to standard output,
    // and finally restore the cursor.
    // Run the program.  Call up the dialog box.
    // Move the dialog box to outside the main frame --
    // that is, no parts of the dialog box and main frame should overlap.
    // Close the dialog box.  Right away move the cursor over the main frame.
    // Notice that the cursor is not an hourglass,
    // but rather a resize cursor.
    // Now shutdown the program and run it again.  Call up the dialog box.
    // Move the dialog box to inside the main frame.
    // Upon pressing OK or Cancel, we do see the wait cursor for 5 seconds.
    // If we call up the dialog box again and move outside the main frame,
    // then upon closing the dialog box the hourglass appears.
    // However, if we shutdown and restart then the resize cursor appears.
    // Why do we only see the hourglass when the dialog box is
    // inside the main frame?
    public class MyFrameDisposeDialogFirst extends JFrame
       private JButton jButton1 = new JButton();
       public MyFrameDisposeDialogFirst()
          try
             jbInit();
          catch (Exception e)
             e.printStackTrace();
       private void jbInit() throws Exception
          this.getContentPane().setLayout(null);
          this.setSize(new Dimension(400, 300));
          jButton1.setBounds(new Rectangle(80, 60, 73, 22));
          this.getContentPane().add(jButton1, null);
          jButton1.setAction(new AbstractAction("Dialog") {
             public void actionPerformed(ActionEvent event)
                try
                   String[] choices = new String[] { "One", "Two", "Three", "Four" };
                   Object result = JOptionPane.showInputDialog(MyFrameDisposeDialogFirst.this, "Username", "Title", JOptionPane.QUESTION_MESSAGE, null, choices, choices[1]);
                   MyFrameDisposeDialogFirst.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                   try
                      Thread.sleep(5000);
                   catch (InterruptedException e)
                   System.out.println(result);
                finally
                   MyFrameDisposeDialogFirst.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
       public static void main(String[] args)
          JFrame frame = new MyFrameDisposeDialogFirst();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
    }

    It's the old story of not respecting the EDT and [Concurrency in Swing|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html]. Try this (could be better but I tried to keep the changes to a minimum):import java.awt.Cursor;
    import java.awt.Dimension;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.SwingUtilities;
    import javax.swing.Timer;
    public class MyFrameDisposeDialogFirst extends JFrame
       private JButton jButton1 = new JButton();
       private Action action = new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
             MyFrameDisposeDialogFirst.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
       private Timer timer = new Timer(5000, action);
       public MyFrameDisposeDialogFirst()
          jbInit();
       private void jbInit()
          this.getContentPane().setLayout(null);
          this.setSize(new Dimension(400, 300));
          jButton1.setBounds(new Rectangle(80, 60, 73, 22));
          this.getContentPane().add(jButton1, null);
          timer.setRepeats(false);
          jButton1.setAction(new AbstractAction("Dialog") {
             public void actionPerformed(ActionEvent event)
                String[] choices = new String[] { "One", "Two", "Three", "Four" };
                Object result = JOptionPane.showInputDialog(MyFrameDisposeDialogFirst.this, "Username",
                      "Title",JOptionPane.QUESTION_MESSAGE, null, choices, choices[1]);
                SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                      MyFrameDisposeDialogFirst.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                      timer.start();
                System.out.println(result);
       public static void main(String[] args)
          final JFrame frame = new MyFrameDisposeDialogFirst();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          SwingUtilities.invokeLater(new Runnable() {
             public void run() {
                frame.setVisible(true);
    }db

  • Cursor for certain tools show as 3

    Can anyone pleas tell me why in CS3 on Win 7-64 bit when I go to use tools such as the crop tool, eyedropper tool or some other tools it shows 3 eyedropper pointers or the same with crop tool and others.  They work but it is annoying trying to figure out which of the three pointers to point at the subject. Could someone please enlighten me.

    Go into the OS and reset the text display at
    149 or 151.  Has known problem at 150.
    control panel/appearance/display

  • Can (extend) only inherit certain component??

    I have a class which contain JMenu/Menu Item on the top and in the contentPane i have a JPanel that cover with Picture.When i click MenuItem and link other class,i use extend coz i wanna inherit the JMenu Item again but it inherit The JPANel also.Any idea that i only can inherit the JMenu and not with the JPANEL

    You cannot not-inherit a member... however, you can make the member private and not-accessible to the sub-class.
    One thing to note though, if the parent class has a public or protected method that manipulates the private member, when the sub-class inherits the public or protected method, the sub-class still inherits the power to manipulates the private memeber.

  • How to add (multiple) cursors programmatically in an XY graph?

     how to add (multiple) cursors programmatically in an XY graph?
    I am building an XY graph. then I would like to add cursors at certain locations (positioned on x axis) I determine through a program.
    How can I add cursors programatically?
    Thank you.

    Initialize a cluster array (CrsrList type) with as many cursors as you think you would ever need.   Setup your cursors dynamically, then delete the unused cursors (array elements) and then update your CursorList property.
    Message Edited by vt92 on 03-20-2009 04:04 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
    Attachments:
    cursors.PNG ‏5 KB

  • How can i find out what cursor the user has selected on an xy graph?

    I have an XY graph in which while the program runs it will be creating cursors in certain locations on the plot. I want to give information about this cursor when selected upon, I THOUGT that active cursor does this.. but appreently not.. it seems to jsut keep spitting out 0, any ideas?

    > I have an XY graph in which while the program runs it will be creating
    > cursors in certain locations on the plot. I want to give information
    > about this cursor when selected upon, I THOUGT that active cursor does
    > this.. but appreently not.. it seems to jsut keep spitting out 0, any
    > ideas?
    You might look at the Selected Cursors property. It indicates which
    cursors will be acted upon by the movement palette. It should be
    equivalent to the small LED buttons on the cursor palette.
    Greg McKaskle

  • CK11 costing of repeated component item on bom

    Looking for a product costing solution to the following scenariou2026
    Bill of material contains a component that is listed twice, but with a different procurement indicator (purchase vs. production) for each occurrence.  The reason for this is that these are boms for repair and it is not known until the end item is disassembled whether the components will need to be replaced (and therefore purchased) or repaired (produced).  The procurement type on the material master is u2018Xu2019 for both procurement types.  Using historical statistics, an estimate is done for  what the produced vs. purchased quantities of the component should be.  For example, a repair calls for 10 of a certain component.  Historically, 70% of the time, the component can be repaired and 30% it will have to be replaced.  So, the component is listed once on the item list with a quantity of 7, and procurement indicator of production.  Itu2019s then listed again with a quantity of 3, and a procurement indicator of purchase.  From a logistics execution standpoint (production, MRP) this process is working.
    The problem is using CK11 to cost the end item.  While a cost estimate is created for the component, itu2019s based on the first listing of the component.  So, using my example above, if the production alternative  quantity was listed first, all 10 would be valued at the production value.
    Any ideas on how I can get around this?  Iu2019ve looked at mixed costing, but this would require additional maintenance for the procurement ratios, which we are trying to avoid.
    Thanks in advance

    Hi
    Mixed costing is your only option in this regard....
    Else, what the system is doing currently is the only choice.. OR At best what you can do is you can treat it for costing purposes as In-House i.e. repaired always.. This is because, most of the time it is so
    Regards
    Ajay M

  • How to set cursor after submit via selection-screen

    hi guys,
    i would like to set cursor to certain field, after submit via selection-screen.
    eg.
    SUBMIT   z_mm_kbr_gr_label_01
                VIA SELECTION-SCREEN
                WITH p_mblnr = p_mblnr
                WITH p_zeile = p_zeile
                WITH p_gjahr = p_gjahr
                WITH p_ccode = p_ccode
                WITH p_dcode = p_dcode
                WITH p_crt = p_crt
                WITH p_print = p_print.
    i want to set cursor field 'p_ccode' after going back to
    z_mm_kbr_gr_label_01. the program always go to the first field on the screen whatever i do.
    may i know how to do this?
    thanks.

    Hi,
    Please try like below .
    at selection-screen output.
    SET CURSOR FIELD  'P_CCODE' .

Maybe you are looking for