Bringto front, but while not gaining focus

hi,
I wish to create an aplication which runs in the background, and at pre-determined times apears at the front of the screen momentairily (ontop of any other programs running), and then goes to the back again.
However, what i wish to know is: is it possible to do this, but yet allow whatever program had focus at that time, to keep that focus (for keyboard/ mouse/ and any other devices which might send information to the window with focus.)
is this possible?
is there a difrence between weather its possible on windows or on linux?
hope someone can help.
cheers
james

Not with out JNI.

Similar Messages

  • Windows not gaining focus...

    Hello!
    After recent update (I can't recall having this issue before) windows that previously had focus, but lost it after I opened a new window, do not gain focus after I close the new window. This is very irritating, because now I have to click on the old window all the time, even though it is the top window, to give commands to it.
    The same thing happens also when switching spaces - if I have a window with focus in one space, quickly switch to another to check something (without clicking anywhere) and then go back to the first one, I have to click in the window otherwise I can't write or send commands to it. Even though the cursor is in the window and blinking as if it had focus (if it is an input field).
    A concrete example:
    I am writing this text in Firefox in a textbox on a webpage. I switch spaces forth and back. The cursor is still in the textbox and blinking, but whatever I press nothing happens. Firefox is still the active application (it has the menubar).
    I've tried searching, but wasn't lucky to find anything, is it just me?
    BR,
    stormmind

    It work well in my system. Either on appletview and browser.
    Firefox 3 on Debian Lenny, java 1.6.0_07-b06

  • Excel 2010 not gaining focus correctly

    I am seeing this on my own workstation, but I'm being asked about it by more and more clients lately - Excel 2010 seems to have odd focus issues. For example:
    a) When opening an Excel spreadsheet from Windows Explorer, Excel opens, appears to have focus and does correctly open on top of other open windows, displays the file and I can edit cells, but I cannot click anything in the Ribbon bar or menus. In order
    to gain access to menu items I first have to lose focus (by clicking to another open application, the Task Bar or Desktop - anything that takes focus away from Excel) and then click back into Excel, whereupon the menu items now work correctly.
    b) If Excel is already open and I open another Excel file from Windows Explorer, the new window isn't brought forward - it remains behind the previously open spreadsheet. In addition, Excel isn't given focus at all in this situation - it is retained by Windows
    Explorer (which may or may not be open on the same screen as Excel, although it's more obvious if they overlap as Excel clearly remains behind the Explorer window). Additionally, if all existing spreadsheets are closed but Excel remains open and I open a spreadsheet
    from Explorer, the same behaviour occurs (ie Excel fails to gain focus and it is retained by Explorer).
    My personal workstation is running Windows 7 Pro x64 SP1 (this behaviour was evident before SP1's release) and Excel 2010 version 14.0.4760.1000 (32-bit). I have seen it occuring on other PCs using both 32- and 64-bit versions of Windows 7 Pro and Excel
    2010 (all 32-bit). While the workaround is relatively simple, it's still frustrating (and more than a little confusing for many non-technical people - one of my clients has been frustrated by this for weeks before I discovered she was experiencing the issue).
    I find it a little strange that I have been unable to find references to this problem anywhere (and I've been looking on-and-off for several months now). Maybe I'm just looking for the wrong things... Any help that can be provided will be greatly appreciated.
    Trevor Hardy

    I'm really not sure about the ethics of people being able to mark their own replies as accepted answers on here...
    Jennifer, thank you for attempting to assist with this problem. Unfortunately your suggestion doesn't alleviate the issue.
    As I thought I made clear in my first post, this issue is being seen when opening Excel spreadsheets directly from Explorer (or a desktop shortcut or similar, which is just an Explorer instance anyway) - it doesn't occur if you open files from within Excel.
    Therefore, opening Excel in Safe Mode has no effect - you can open one instance of Excel in safe mode, but when you open another Excel file from outside Excel, of course it opens another instance of Excel in normal mode and the same symptoms are evident.
    However, your suggestion regarding add-ins was a sensible one, so I manually removed the two Adobe Acrobat add-ins that were active on my workstation (the only add-ins installed) but unfortunately that hasn't made any difference. I should also point out
    that these add-ins aren't installed on the other PCs that are experiencing this issue, either, as they are used in wholly different environments.
    I'll be setting up Office 2010 on some new PCs in a couple of days, so I'll do some testing of those to see if I can replicate it on virgin systems.

  • Save As dialog box does not gain focus (bring to foreground) with Windows 7?

    Hello,
    I've got several users with Microsoft Windows 7 (64bit) and Adobe Acrobat 9 Standard (OEM) with the same problem.  When you go to Print to your PDF Printer, the Save As... dialog box does not come to the foreground and gain focus.  Most often it just sits in the taskbar blinking to get their attention.
    However the users get frustrated and often don't realize the Save As box popped up at all.  They did not have this problem with Windows XP.
    I actually can replicate the problem on my own PC.
    Any workarounds for this behaviour?
    Thanks,
    -Tim

    This appears to be a Windows 7 focus issue.
    You can back up your registry and try the fix below, it worked for me.
    Fix number 1
    1. Open Start >> Run and type “regedit” (without quotes)
    2. Navigate to the following path:
    [HKEY_CURRENT_USER\Control Panel\Desktop]
    3. Right Click on the empty space and create a new DWORD value, or modify the existing value named ‘ForegroundLockTimeout’, set or modify the value to 0. (this value will cause the application to take the focus instantly.)
    4. That’s it Done, exit registry and restart windows for changes to come into effect.

  • JTextArea not gaining focus

    I have a tabbed pane consisting of 2 JPanels. Each panel has a text area (within a scrollpane) on both.
    All I want is for the text area to gain focus when its tab has been clicked.
    I've tried adding a changelistener to the tabbedpane:
            tabbedPane.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    if (tabbedPane.getSelectedIndex() == 0) {
                        textArea1.requestFocus();
                    else {
                        textArea2.requestFocus();
            });but the textareas don't get focus. They do when I press <TAB> but this isn't much use.
    Does anyone have any ideas how I can get the textareas to gain focus?

    import javax.swing.*;
    import javax.swing.event.ChangeListener;
    import javax.swing.event.ChangeEvent;
    import java.awt.*;
    public class TestFocusTabbedPane extends JTabbedPane {
         private JTextArea theFirstTextArea;
         private JTextArea theSecondTextArea;
         public TestFocusTabbedPane() {
              super();
              JPanel tabPanel = new JPanel(new BorderLayout());
              tabPanel.add(new JButton("just for test"), BorderLayout.NORTH);
              theFirstTextArea = new JTextArea();
              theFirstTextArea.setFocusable(true);
              tabPanel.add(new JScrollPane(theFirstTextArea), BorderLayout.CENTER);
              addTab("first", tabPanel);
              tabPanel = new JPanel(new BorderLayout());
              tabPanel.add(new JButton("just for test"), BorderLayout.NORTH);
              theSecondTextArea = new JTextArea();
              theSecondTextArea.setFocusable(true);
              tabPanel.add(new JScrollPane(theSecondTextArea), BorderLayout.CENTER);
              addTab("second", tabPanel);
              addChangeListener(new ChangeListener() {
                   public void stateChanged(ChangeEvent e) {
                        int index = getSelectedIndex();
                        if (index == 0) {
                             theFirstTextArea.requestFocus();
                        } else {
                             theSecondTextArea.requestFocus();
         public static void main(String[] args) {
              final JFrame frame = new JFrame(TestPressedButton.class.getName());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add(new TestFocusTabbedPane());
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.pack();
                        frame.show();
    }This seems to work. I added the JButton just to show that it doesn't get the focus

  • JTextField not gaining focus on initialization of Applet

    I originally tried posting this in the Applets forum but was unable to get a response, so I am re-posting here in hopes of finding an answer.
    I have a simple JApplet with a JFrame, a JTextField added to the JFrame, and a WindowListener added to the JFrame that requests focus to the JTextField whenever the JFrame is activated. Upon opening the applet the WindowListener's windowActivated() method is called and requestFocusInWindow() for the JTextField returns true however the focus is never actually given to the JTextField. According to the API for Component,
    "This method returns a boolean value. If false is returned, the request is guaranteed to fail. If true is returned, the request will succeed unless it is vetoed, or an extraordinary event, such as disposal of the Component's peer, occurs before the request can be granted by the native windowing system. Again, while a return value of true indicates that the request is likely to succeed, developers must never assume that this Component is the focus owner until this Component receives a FOCUS_GAINED event"
    I am assuming that the request is getting "vetoed" but I don't understand why or what this even means. If I alt-tab off of the applet window and alt-tab back on then the request is handled properly. This issue only arises on initially opening the applet. Has anyone seen this issue before? Is there a known workaround? Here is the code for my sample applet:
    import javax.swing.*;
    import java.awt.event.*;
    public class MyApplet extends JApplet{
    private JFrame myFrame;
    private JTextField myTextField;
    private FrameWindowListener myListener;
    public void init(){
    myFrame = new JFrame();
    myFrame.setSize(700, 360);
    myFrame.setLocation(100, 100);
    myTextField = new JTextField();
    myFrame.add(myTextField);
    myListener = new FrameWindowListener();
    myFrame.addWindowListener(myListener);
    public void start(){
    myFrame.setVisible(true);
    myFrame.pack();
    public class FrameWindowListener extends WindowAdapter{
    public void windowActivated(WindowEvent e){
    boolean focus = myTextField.requestFocusInWindow();
    if(focus){
    System.out.println("Focus successful");
    } else{
    System.out.println("Focus unsuccessful");
    }

    Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
    http://forum.java.sun.com/help.jspa?sec=formatting
    Works fine for me using JDK1.4.2 on XP using appletviewer.
    The only suggestion I would make is that you should use pack() before setVisible(...). Also I usually have that code in the init() method instead of the start() method.

  • Updated Firefox to 32.0 and now e-mail links put browser in front but do not open new tab or link!

    Just that. Firefox comes to front of desktop, but neither new tab nor the link open.
    This has always worked just fine, before this update today.
    I am on a Mac running 10.6.8.
    Thank you for your help!

    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache
    Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    and
    * Remove Cookies
    '''''Warning ! ! '' This will log you out of all sites you're logged in to.'''
    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by;
    Windows; '''Tools > Options'''
    Linux; '''Edit > Preferences'''
    Mac; ''application name'' '''> Preferences'''
    Then '''Privacy.'''
    Under '''History''', select Firefox will '''Use Custom Settings'''.
    There is a button on the right side called '''Show Cookies'''.
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by;
    Windows; '''Tools > Options'''
    Linux; '''Edit > Preferences'''
    Mac; ''application name'' '''> Preferences'''
    Then '''Advanced > General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • Focusable JTextArea not gaining focus.

    I am creating a JTextArea and want to give it the focus when it's created. THis happens twice in the program, and the first time it works, the second time the JTextArea is created but doesn't get the focus until I click on it.
    In both cases the code is called from the Swing event queue (see the output below). In both cases the class which creates the jTextArea is the same (an extension of JPanel), and is added to a new tab in a tabbed pane.
    Because I know that you need to make sure that the component's been created before it gets focus, the code to create it and give it focus is:
    private javax.swing.JTextArea jtaInfo;
    // Class constructor for outer class
      public PanelInfo(String s, boolean editable ) {
        initComponents();  // this is the NetBeans call which creates jtaInfo and a few buttons
        jtaInfo.setText(s);
        jtaInfo.setEditable(editable);
        setVisible(true);
        selectTextBox();
      public void selectTextBox() {
        UtilFunctions.tcaProgramInfoMessage("selectTextBox thread="+Thread.currentThread().getName());
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            UtilFunctions.tcaProgramInfoMessage("Runnable thread="+Thread.currentThread().getName());
            UtilFunctions.tcaProgramInfoMessage("Info frame focusable: "+jtaInfo.isFocusable());
            if (!jtaInfo.requestFocusInWindow()) {
              UtilFunctions.tcaProgramInfoMessage("Failed to give info pane focus");
      }The UtilFunctions.tcaProgramInfoMessage call produces output with a timestamp.
    The output is:
    Sat Nov 11 11:25:38 GMT 2006: selectTextBox thread=AWT-EventQueue-0
    Sat Nov 11 11:25:38 GMT 2006: Runnable thread=AWT-EventQueue-0
    Sat Nov 11 11:25:38 GMT 2006: Info frame focusable: true
    Sat Nov 11 11:25:44 GMT 2006: selectTextBox thread=AWT-EventQueue-0
    Sat Nov 11 11:25:44 GMT 2006: Runnable thread=AWT-EventQueue-0
    Sat Nov 11 11:25:44 GMT 2006: Info frame focusable: true
    Sat Nov 11 11:25:44 GMT 2006: Failed to give info pane focus
    So it seems that the threads are OK, and the area is focusable, but I can't work out why one succeeds and the other fails. The program's too huge to post here - I may be able to cut it down to size. But is there anything obvious that I might be doing wrong?

    Because I know that you need to make sure that the component's been created before it gets focus,Actually the parent frame or dialog must be "realized" (maybe thats what you mean by "created") before a component can receive focus. This basically means that you've done a pack() or setVisible(true) on the frame. Using setVisible(true) on the actual component does nothing since by default all JComponents are visible.
    The program's too huge to post here - I may be able to cut it down to sizeI fail to see why its so difficult to create a short demo program showing the problem. The code you posted doesn't help because we don't know the context of how the code is executed.
    Below is a simple demo that shows an incorrect version and a correct version in 10 lines of code. So if this code doesn't help solve the problem you will now need to wait hours again until you post a version of your code that does demonstrate the problem. Whereas if you had spent 5-10 minutes to create a demo that doesn't work I may have been able to help you out right now.
    Simplify your problems and the answer will also be simpler.
    import java.awt.*;
    import javax.swing.*;
    public class FocusTest
         public static void main(String[] args)
              JTextField textField1 = new JTextField("One");
              JTextField textField2 = new JTextField("Two");
              JTextField textField3 = new JTextField("Three");
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.getContentPane().add(textField1, BorderLayout.NORTH);
              frame.getContentPane().add(textField2, BorderLayout.CENTER);
              frame.getContentPane().add(textField3, BorderLayout.SOUTH);
              // This doesn't work
              textField3.requestFocusInWindow();
              frame.pack();
              // This does work
    //          textField3.requestFocusInWindow();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }

  • Why does my mac not switch focus between applications

    All,
    I have a very inconvenient problem on my mac.
    Every time when I click on a link in e.g. Mail or Twitter, my Mac opens the link in Safari but does not switch focus to the Safari window with the loaded page.
    Similar behaviour in every application.
    Does anyone has an idea?
    Thanks,
    equi

    Carolyn,
    thanks, but this did not solve my problem. The issue is, that Safari itself does not get the focus and I am not brought to the space where Safari has opened the page.
    I tried your suggestion, turned the setting on and off and on again, but the behaviour is still the same. I assume that it has something to do with spaces itself.
    Thanks for your time having responsed to my post,
    equi

  • VFL Speaker sound from both the front speakers while FR sound is not coming out at all.

    I have a creative gigaworks s750 connected to a xtreme gamer sound card. The system was working absolutely fine but now it has started behaving very strangely; system is playing back Front Left Speaker sound from both the front speakers while Front Right sound is not coming out at all. If i click the front right speaker in audio console speaker setup wizard, no sound comes. However when i click the front left speaker, sound comes out of both speakers. I counter checked it with playing 5.1 dts movie and muting all the speakers except the front left one from ac3 filter, sound came out of both the front speakers. However when i muted all the channel except the front right, no sound was coming out of front right speaker.
    Message Edited by hussain on 06-10-2009 10:26 PM

    Just want to add another relieved reader of this thread.  I had lost the sound to my speakers even though I had sound to headphones. I was convinced it was a damaged headphone jack because I had pushed the headphone plug in harder the last evening when my wife complained that she could still hear the speakers while I listened with the headphones.  The next morning--no speaker sound.
    I spent a few hours searching the web to see how to disassemble a satellite A505 and get to the jack.  But I wasn't even sure I could get a proper replacement jack that fit, and I was concerned that small damage, say to the ribbon connectors could render the computer useless--a large price to pay for just missing audio.  
    Fortunately, I stumbled onto this thread and I recalled I had put the unit to sleep the night before--something I don't usually do, but I didn't want all the Chrome web sites to have to reload so I just put it to sleep.
    When I put it to sleep again and fired it up--Sound!  I am so glad to find this solution so I just want to let people know it remains a viable option.
    Doug

  • I have an apple id but ı can not use it for sign in to itunes connect account while publishing my ibook document. Why ı can not login? What can ı do to figure out this problem?

    I have an apple id but ı can not use it for sign in to itunes connect account while publishing my ibook document. Why ı can not login? What can ı do to figure out this problem?

    As note already on the iBA forum [ AppleID for ibooks publishing ], you need two IDs. You can't use your developer ID.
    If you already signed up for books with that ID, you need to talk to Apple to straighten things out.

  • HT1386 My iOS device (Ipad mini) only appears in iTunes while cable-connected, but does not appear after diconnect the cable. How can I Wifi sync ?

    Hi, My iOS device (Ipad mini) only appears in iTunes while cable-connected, but does not appear after diconnect the cable. How can I Wifi sync ?
    Documents say
    Whenever the computer and the iOS device are on the same network, the iOS device will appear in iTunes, and you can sync it....
    But I can't see my iPad Mini in iTunes.
    And my  Ipad  (Settings, General, iTunes Wifi Sinc)  shows  a message :" Sync will resume when xxx(my PC with iTunes) is available "...
    Both are in the same network,
      Ipad mini is is plugged in to power
    . iTunes is open on the computer
    what can i Do ???

    Hi Skydiver119,  and tks for four interest.
    I have done exactly as you say, but it does not work for me.
    You indicated  " Navigate to the info tab and scroll down. There'll be a check box for 'sync over wifi' or something to that effect. Check that box and sync to affirm your choice."
    I navigated to Summary tab (not Info Tab) and checked "Sync with this ipad over Wi-Fi"
    I disconnect the wire,
    and my iPad disappears from my iTunes screen.
    in my iPad ->Settings -> General -> iTunes Wi-Fi Sync -> says " Sync will resume when (my PC) is available.
    So, I can not sync via wi-fi
    I appreciate if you can help me.

  • HT5622 My apps are not updating as I have no longer access to my eariler apple Id and now I am using a new apple Id which is allowing to download  apps but while updating those apps my iPod wants eariler apple Id password to update what should I do ?

    My apps are not updating as I have no longer access to my eariler apple Id and now I am using a new apple Id which is allowing to download  apps but while updating those apps my iPod wants eariler apple Id password to update what should I do ?

    Hi Kanishk,
    Those apps are forever tied to the Apple ID they were purchased under. You can either delete them and re-purchase them, or you can go to Manage your Apple ID and reset the password on the old Apple ID so you can use it to update your apps: Apple - My Apple ID
    If you decide to continue to use them under the old ID password, I would suggest that when you reset that password, you change it to be the same password as the one you are currently using. That way when apps need to be updated you will only need to know one password and you won't have to be concerned with which Apple ID is displaying.
    Cheers,
    GB

  • Battery charges when asleep but will NOT charge while awake

    Hello -
    By battery will charge when off/asleep but will not charge while awake. It just slowly drains to nothing and dies even though adapter is plugged in. magsafe adapter light is green when open/on and orange when off/asleep and lights on battery indicate charging while in the latter state. still using stock battery that came with computer when I got it a few years ago, so it's not new by any means, but when fully charged lasts as long as it used to. I would think maybe charger is issue, but it DOES charge, just not while awake. not sure why computer wouldn't still work correctly while plugged in if in battery indicator it says power source is "power adapter," but its not. I have tried resetting PMU and calibrating battery. the combo of the two seemed to work when having issue a few months ago, but it just started doing it again. frustrating because once it dies I have to wait several hours until its fully charged again, so it cramps the workflow... any ideas? battery info from profiler below.
    Cheers,
    Ian
    Battery Information:
    Model Information:
    Serial Number: DP-ASMB013-3556-2063
    Manufacturer: DP
    Device name: ASMB013
    Pack Lot Code: 0001
    PCB Lot Code: 0000
    Firmware Version: 0102
    Hardware Revision: 0300
    Cell Revision: 0100
    Charge Information:
    Charge remaining (mAh): 81
    Fully charged: No
    Charging: No
    Full charge capacity (mAh): 4571
    Health Information:
    Cycle count: 827
    Condition: Good
    Battery Installed: Yes
    Amperage (mA): -1134
    Voltage (mV): 10921
    System Power Settings:
    AC Power:
    System Sleep Timer (Minutes): 60
    Disk Sleep Timer (Minutes): 10
    Display Sleep Timer (Minutes): 20
    Automatic Restart On Power Loss: No
    Wake On AC Change: No
    Wake On Clamshell Open: Yes
    Wake On LAN: Yes
    Display Sleep Uses Dim: Yes
    Battery Power:
    System Sleep Timer (Minutes): 5
    Disk Sleep Timer (Minutes): 10
    Display Sleep Timer (Minutes): 1
    Wake On AC Change: No
    Wake On Clamshell Open: Yes
    Display Sleep Uses Dim: Yes
    Reduce Brightness: Yes
    Hardware Configuration:
    UPS Installed: No
    AC Charger Information:
    Connected: Yes
    Charging: No

    Scott - Your answer ultimately led me to the answer, albeit months later, after much internal deliberation and some trial and error... thanks!
    Ruled out battery (as crazy as that sounds - it's had a bajillion cycles) as it didn't make sense that battery would charge but wouldn't work while awake. I have a friend whose battery is completely shot and his still works as long as magsafe is plugged in, and mine wouldn't even do that. tried another adapter and that worked. then tried mine in a different plug. so in the end, turns out I had a bum powerstrip... mag safe / battery recharge works properly when just plugged in somewhere different.
    So no need to buy a new charger or battery (yet!)
    thanks to all,
    Ian

  • While dealing with an external hardware i got a Java update4 request,but was not able to complete that update.After that when i switch on my Mac it shows reinstallation required.i was working with OSX 10.8.5,but after reinstallation now it is 10.7.5 .

    While dealing with an external hardware i got a Java update4 request,but was not able to complete that update.After that when i switch on my Mac it shows reinstallation required.i was working with OSX 10.8.5,but after reinstallation now it is 10.7.5 .And while doing search for update it shows your software is uptodate..

    Hi Hal,
    One possibility, is a strange occurence when applying the big 10.5.8 combo, most people have to Repair Permissions twice in a row, then reboot.

Maybe you are looking for