Popup a JDialog without it gaining focus. Can it be done?

Can it be done?
I have thought about having a JDialog already on screen but positioned off screen and move it onscreen when needed but seems a ugly idea. Any one got a nicer solution?

setFocusableWindowState(false) sort of works but the jDialog does gain focus then focus is given back to whatever window had focus before the JDialog was shown.

Similar Messages

  • JDialog without focus

    Is there any way to popup a dialog, but not giving it selection/focus?
    Here is an example: We developed a trading system that popups (asynchronously) a JDialog whenever a new trade is received. This JDialog gets the keyboard focus whenever it is displayed.
    This behaviour becomes annoying to the users: user may be typing an e-mail message in outlook window and he gets interrupted quite often by loosing focus to the popup dialog.
    Question: is there any way to popup a non-modal dialog in such a way that it is visible but does not gain focus and does not interfere with what user is currently doing.
    Best Regards,
    Paul

    We had a similar idea and decided to go a different route when we couldn't figure out the same dialog problem you have.
    We opened a text window and wrote entries into a scrollable log. It was a little more work and took a little more processing, but the reward seemed worth it.
    The user could acknowledge the entries at his/her leisure, just as you hoped to accomplish with the Dialog boxes.
    We also realized how nice it was to not have to deal with a cluttered taskbar that many JDialogs would have created. Annoying internet pop-ups do that for us, without us having to write a single line of code. ;)
    Good luck

  • Preventing a JFrame/dialog from showing in the task bar & gaining focus.

    As the (lengthly) title suggested, I would like to know if it is possible to create a JFrame or JDialog that can run (more or less) on its own without appearing in the task bar or gaining focus when setVisible() is called.
    Anyone know how to do this, or have better Google search term to use than the ones I thought up? ;-)

    The point is for it to stay visible (normally) when when it is not hidden (it is hidden for ~1 second to take a screenshot) and then shown again. The problem with this is that the application currently in focus loosees it (which is very annoying when typing...).
    I'm trying to make a 'desktop button' of sorts that just acts as a tray icon when the system tray isn't supported. I put some effort into making it have a transparent background, but by doing that setVisible() is called every 15 seconds or so. (the frame is alwaysOnTop as well), thus the reason that I don't want the focus to be taken.
    As for not showing in the system tray, I don't really need it although it would certainly make the icon better.
    With that said, is there some way to accomplish this?
    Thanks for the quick reply!

  • 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.

  • 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

  • Issue in FF v 3.6.10: I have a page which have more than 20 link, clicking on these link opens up a popup using window.showModalDialog, for the first 20 popup opens up without any prob but for the 21st n more click it block the popup and do not open.

    Issue in FF v 3.6.10: I have a web page which have more than 20 link, clicking on each of these link opens up a pop-up using window.showModalDialog, for the first consecutive 20 popup opens up without any prob but for the 21st n more click it block the popup and do not open. This is m problem, the real user on the web page can click on more than 20 link in such a scenario it may create problem, please help

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Hyperlink on Crystal Report: how to popup a window without menubar?

    Hyperlink on Crystal Report: how to popup a window without menubar?
    Hello Experts!
    I'm using VS2003 with Crystal Reports for VS2003.
    I need to show a popup window clicking a hyperlink text object on my crystal report.
    On the CrystalReportViewer I have set up HyperlinkTarget=_blank, and it's working fine.
    But when I click on the hyperlink and shows the popup window, how can I show the popup window without menubar, toolbar, directories, etc.
    Something like:
    window.open('../MyPage.html?id=id001" + Cad + "',null,'menubar=no,scrollbars=yes,toolbar=no,location=no,directories=no,resizable=yes,status=yes')

    Adam is correct. The closest you can get is setting the CrystalReportViewers HyperlinkTarget to _blank. It was seen as a potential security vulnerability to allow you to run scripts from a Crystal Reports. In our Enterprise product you can use a reg key called EncodeHTMLForSingleLineFieldObjects to control whether this can be turned on or off.
    Unfortunately this was never ported over to our .NET CrystalReportViewer.
    This is referenced in notes 1202803, 1219298, and 1219301.
    https://www.sdn.sap.com/irj/sdn/businessobjects-notes
    Edited by: David Hilton on Jul 16, 2008 4:17 PM

  • Applet in a browser page  doesn't gain focus with JVM 1.6.x

    Hi,
    I have a problem to move TAB in a IE browser page with applet in a tag object using JVM 1.6.x
    with JVM 1.5_10 or above this is possible. You can move focus between elements page and enter and exit to applet object.
    Executing the same applet with the same JVM, but after installation of the latest 1.6 plugin, when applet gains focus it doesn't release it.
    With JVM 1.6, applet can't gain focus and manage keyevents; all keyevents are intercepted from browser (eg: IE toolbar elements are activated) .
    I need to move focus on elements of browser page with tab, and enter and exit from applet to make my application accessible event not using mouse !!
    (you can watch a recorder right sample here: http://www.vista.it/ing_vista_0311_video_streaming_accessibile_demo.php)
    Note that FireFox doesn't work at all, even if bug seems fixed https://bugzilla.mozilla.org/show_bug.cgi?id=93149
    Please advise.

    Hi,
    We have found a wor around for this problem.
    The following option has been unchecked and the applet could be loaded.
    Go to java control panel
    Under the Advanced Tab
    Under the Security section
    Uncheck the last option "Use TLSv1.0".
    This makes the applet work.
    But could not understand as why this is creating a problem.
    We have tried to include TLSv1.0 in the cipher suite of our apache server, while keeping the above option in java plugin control panel checked, but even that did not solve the problem.
    Please help me of how should I proceed for this problem, as I am totally stuck.
    Thank you.

  • PDF popup, in FireFox, without being prompted

    Hello, I am using Windows XP Pro, SP3, fully patched and updated. My Adobe Reader is version 9.5.0. I am currently using FireFox 3.6.25, but this problem has been affecting my computer for the last year and a half, and happens with newer versions of FireFox, up to and including version 8. I downloaded a PDF file of an air compressor users manual and saved a copy to a folder on my desktop (where I store all of my PDF files). 
    Now, whenever my FireFox browser is up and running, this PDF file will pop up every three hours, or so. It will initially pop up about ten minutes after the browser is started, and then about three hours after I close the reader program. It, neither the file, nor Adobe Reader, asks for permission to run, the PDF file, just comes up fully formed and running in Reader.
    I have search in my Reader preferences/options/setting and can’t find any setting, control, action, button or choice that allows me to stop this pop up behavior. I can move the file to another location on my “c” drive, move it to another hard drive altogether, or even rename it, all to no avail, the popup behavior remains.
    Is this a Adobe “problem”, or setting, a FireFox problem (as it only happens when the FireFox browser is running), or something else I am not aware off? Thanks for any help, in advance!!

    Hello Ankit, and thanks for help:
    This behavior only happens with this one PDF, no others, and I have hundreds saved to the same folder.
    Speak of the devil, as I was typing the first sentence of this email, it popped up. My FireFox browser is set to start when I boot my computer, and that happened about ten minutes ago.
    I rarely use IE and never use any other browser. When I do use IE it is only for those websites that still don't function properly with FireFox, and I generally get there via a FireFox add-on that opens a version of IE within the FireFox browser. Also on rare occasions, I will open IE directly to view my daughters school grades, again because that website doesn't handle FireFox properly. In any case, whenever I use IE, I only keep that tab or browser running for a very short period of time, just long enough to capture my data needs, generally less than five minutes, then shut it down,........ But, I don't recall this PDF behavior ever happening with the IE usage.
    Here are the PDF's Document Properties:
    Under the Description tab:
      Description:
        1.. File : Tecumseh_replacement_parts-7.pdf
        2.. Title: parts book.indd
        3.. Author: (blank)
        4.. Subject: (blank)
        5.. Keywords: (blank)
        6.. Created: 4/19/2005 9:00:26 AM
        7.. Modified: 10/31/2005 8:52:35 AM
        8.. Application: Adobe InDesign CS (3.0.1)
      Advanced:
        1.. PDF Producer: Adobe Library 6.0
        2.. PDF Version: 1.3 (Acrobat 4.x)
        3.. Location: C:\Documents and Settings\.....Temp\
        4.. FIle Size: 2.18 MB
        5.. Page Size: 8.50 x 11.00 in
        6.. Tagged PDF: Yes
        7.. Number of Pages: 50
        8.. Fast Web View: Yes
    Under the Security tab:
      Document Security
        1.. Security Method: No Security
        2.. Can be Opened by: All versions of Acrobat
      Document Restrictions Summary:
      (everything is allowed except Document Assembly, Commenting, Signing, and Creation of Template Page)
    Under the Fonts Tab: .......
    Under the Advanced tab:
      PDF Settings:
        1.. Base URL: (blank)
        2.. Search Index: (blank)
        3.. Trapped: No (greyed out)
      Print Dialog Presets: (all greyed out)
        1.. Page Scaling: Default
        2.. Duplex Mode: Simplex
        3.. Paper Source by Page Size: No
        4.. Print Page Range: (blank)
        5.. Number of Copies: (dropped down box)
      Reading Options:
        1.. Binding: Left Edge
        2.. Language: (blank)
    Tell me about, and how to do it:
    If I understand your request, it means remotely accessing my computer's drives to observe the PDF's behavior, program settings and preferences, registery settings, etc. I am not comfortable doing that, as my computer has a large amount of proprietary business information and personal financial information. If there is information I can pass on to you manually, or if I can contact you when the behavior happens, that would be OK.
    Thanks again for your help.
    dgruber
    From: Ankit_Jain
      To: dgruber06
      Sent: Tuesday, January 31, 2012 9:23 AM
      Subject: PDF popup, in FireFox, without being prompted
            Re: PDF popup, in FireFox, without being prompted
            created by Ankit_Jain in Adobe Reader - View the full discussion

  • How to gain focus to a JTextField in a Jwindow

    Hi Friends
    I am trying to create a Login screen which covers the entire desktop using a Jwindow.
    I have one JTextfield and JPassword field in the Jwindow but i am not able to gain focus to those text fields and not able to type anything in those fields...
    I am using java 1.4.2
    This is my program...
    public class Login implements ActionListener
            JWindow fs;
            JTextField tx1;
            JPasswordField tx2;
             public Login ()
                 fs= new JWindow(new JFrame());
                 tx1= new JTextField(12);
                 tx2= new JPasswordField(12);
                 JButton jb = new JButton();
                 fs.getContentPane().setLayout(new FlowLayout());
                 fs.getContentPane().add(tx1);
                 fs.getContentPane().add(tx2);
                 fs.getContentPane().add(jb);
                 fs.setSize(300,300);
                 fs.setVisible(true);
                 fs.show();
                 fs.toFront();
    public void actionPerformed (ActionEvent e)
         System.out.println("User id "+tx1.getText()+" and Password is : "+tx2.getText()):
    public static void main(String[] args)
        new Login();
         Can some one help me in solving this issue with JWINDOW... Plz dont suggest JFrame , since i am not willing to use that header....
    Thanks in advance
    Ur Friend.

    Swing releated questions should be posted in the Swing forum.
    Check out this posting, found in the Swing forum:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=675445
    Plz dont suggest JFrame , since i am not willing to use that header....
    JFrame.setDefaultLookAndFeelDecorated(false);

  • 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.

  • Gainer Focus and Lost Focus

    How implements the methods to gainer focus and lost focus?
    Thanks

    Use a node.focusedProperty() change listener to know when a field gains or loses focus.
    Call node.requestFocus() to ask for focus (for some reason I have to wrap this in Platform.runLater to get it to actually do anything).
    Call node.setFocusTraversable(false) if you don't want the user to be able to tab to the node, but still be able to click on the node to give it focus.
    Call node.setDisable(true) if you don't want the node to be focusable at all.
    I'm not sure how the focus traversable order is calculated, perhaps the order that items are added to the scene?
    Not sure how you would create a custom focus traverse if you needed one.
      @Override public void start(Stage primaryStage) {
        final TextField tf1 = new TextField("First but not initially focused");
        final TextField tf2 = new TextField("Second initially focused");
        Platform.runLater(new Runnable() { public void run() { tf2.requestFocus(); } });
        final TextField tf3 = new TextField("Can focus by clicking on, but not by tabbing to.");
        tf3.setFocusTraversable(false);
        final TextField tf4 = new TextField("Cannot focus at all.");
        tf4.setDisable(true);
        tf1.focusedProperty().addListener(new ChangeListener<Boolean>() {
            public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
              if (newValue) {
                System.out.println("First text field gained focus");
              } else {
                System.out.println("First text field lost focus");
        VBox root = new VBox(); root.setSpacing(5);
        root.getChildren().addAll(tf1, tf2, tf3, tf4);
        primaryStage.setScene(new Scene(root, 300, 100));
        primaryStage.show();
      }

  • Resize jdialog without flicker effect

    I made a vertical tool palette with a JDialog : I have "setcontentpane" a JPanel with vertical boxlayout.
    This JPanel contains other JPanels (class PaletteZone extends JPanel) that act like tool zones : they can be collapse or expand. If you want to have look of what i'm talking about, there is an image here of the palette :
    http://db-maths.nuxit.net/im1.png
    Here is my problem... I have a PaletteZone method used to collapse the tool zone :
    public void collapse(){
            ContentVisible=false;
            ZoneTitle.title.setIcon(rightTriangle);
    // component 0 is the zone title bar, component 1 an icon set (within a JPanel) :
            this.remove(1);
            JP.validate();
    }******* 1) When I use JP.validate, there is no flickering at all and the zone collapse nicely. BUT the JDialog isn't set to the good size. If you want to have a look on what you get when you clic on "Construction" :
    http://db-maths.nuxit.net/im2.png
    ******* 2) If I use JP.pack(), of course the dialog is correctly resized and redrawn. BUT there is a flickering effect : I've made some tries on JFrames and JDialogs and I saw that a pack() call clear immediatly the background and then send a paint call : this "clear/paint" sequence makes a bad flickering effect. I have a quite recent computer (G5 and OS X), and I use java 1.4.2 so I don't think the fact that I see this flicker is caused by hardware or software...
    ******* 3) If I use JP.setSize(), things behave exactly like if I do a pack() call...
    Do you know what I could do to avoid this flicker ? to set the size to the JDialog without this "clear/paint" sequence ?

    you will have to create a jpanel and place this in the dialog's NORTH.
    add a mouseListener to the panel and provide your own moving-handling.
    this.setLocation((int) (this.getX() + e.getX() - m_iOffset.getX()) ...
    this.repaint();you'll have to set m_iOffset wehen mousePressend, and call the moving method when mouseDragged.

  • 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

  • Forcing JLabel to gain focus - how?

    Hi people,
    how can i force a JLabel to gain focus?
    Already tried overwriting isFocusable() -> did not work.
    Thanks for any help.
    Cheers,
    Mark

    requestFocus() does work. atleast in my sdk it does 1.4.1_01.
    do a requestFocus() and then a System.out.println(jLabel.hasFocus());
    the problem is that there is no way to tell that you have focus (no border, etc.) like buttons. probably in your subclass you will need to implement a focus listener to draw a border around the JLabel whenever it has focus and whenever it loses focus...
    i don't know though as i've never done something like this before.

Maybe you are looking for

  • Can't open file after upgrade to 10.8.1

    I use Indesign CS5(Trad. Chinese version). When i upgrade to 10.8 is no problem, but when i upgrade to 10.8.1 last week, i can open any previous ID document! Even i create a new document , i close it , & also cant open!! Its shows a dialog box means

  • Return parameter of cursor_type from a package.

    When running or debugging a database package, it appears that a return parameter of cursor_type can not be handled in that SQL Developer will not display the contents of the cursor. We have a large number of packages that contain cursors as output pa

  • Use Events or delegates in my application??

    I am trying to implements events in c#. my scenario is that there will be multiple events and there will be multiple events listeners to an event(many to many relationship). the problem here is since there are many events and if i implement all in on

  • Flash 9 and 10 .as editor slow in Vista/7

    I've posted an observation about this here that contains some tests about the CPU usage of the ActionScript editor in Flash 10.0.2. The problem is that the editor is slower than any editor I have used, including NetBeans which has the most active cod

  • (( Hello -ENABLE REPORT PRINTING - OPTION NOT SHOWING  ))

    2010-07-28 Hello, I am trying to print a report in APEX 4.0 using the free account APEX.ORACLE.COM . I learning how to do this using the tutorial at: http://st-curriculum.oracle.com/obe/db/apex/r40/apexstart/apexstart_b/apexstart_b_ll.htm In the tuto