Window « Focus « Java Swing Q&A





1. Making an Unfocusable Window in Java    stackoverflow.com

(SOLVED: a WindowStateListener and a deferred call to toBack whenever the window is focused) Hello all! I've been trying to figure out how to make a java.awt.Window (any subclass will do) so that ...

2. How to create component that does't give focus to the Window    stackoverflow.com

I have JTextField with FocusListener that call textfield.grabFocus() every time when textfield lose focus. But unfortunetly, it allow parent Window to react on user action. Is there any way to don't ...

3. Java Swing popup window losing focus and not repainting    stackoverflow.com

I have a simple Java Swing GUI Form with a browse button. The browse button creates a new JFileChooser when it's clicked. However, if you click browse immediately after the window opens, ...

4. Forcing a java app to become the focused window    stackoverflow.com

Is it possible to write something that will auto make a java app the focused window every thirty or so seconds or does this need to be something done at the ...

5. Focusing on a particular window    coderanch.com

6. How to write focus listener or window listener for a Window sub class?!!    coderanch.com

reposting code in readable format import java.awt.*; import java.awt.event.*; class subWindow extends Window{ subWindow(Frame owner){ super(owner); Button b1=new Button("Press me"); setSize(200,200); setLayout(new FlowLayout()); setVisible(true); addFocusListener(new myFocusAdapter(this)); addWindowListener(new myWindowAdapter(this)); addComponentListener(new myComponentAdapter(this)); } } class subFrame extends Frame{ subWindow win; subFrame(){ super(); win=new subWindow(this); } } class myFocusAdapter extends FocusAdapter{ subWindow win; public myFocusAdapter(subWindow win){ this.win=win; } public void focusGained(FocusEvent we){ // this ...

7. Changing window focus    coderanch.com

8. Losing focus after bringing another window into focus    coderanch.com

i've had similar probs, but i'm using 1.4.x. some probs were related to bizarre behavior following a load of window events i don't know why the focus is lost - there have been several focus mods to awt and swing, and focus defaults are also influenced by platform (esp pre 1.4)... have you tried requestFocus (1.3) requestFocusInWindow (1.4) on the component(s) ...

9. retaining window focus    coderanch.com

Hi all, I want my application window to retain the focus as long as the application is running i.e. i don't want the focus to be shifted to another window. I have tried trapping the keyPressed event and setting the keycode to some other value...but it did'nt worked out. Is there any other way out? How should I go about it? ...





10. window focus    coderanch.com

No, show() won't bring it to the front. You oughtn't to use show() at all, but setVisible(true). I think you were correct in your first suggestion; there is a method in the API; it is called toFront(). There are several like that, toFront(), toBack(), and setAlwaysOnTop(boolean), which will have your Window on top all the time, which is probably not what ...

13. Window switching focus    coderanch.com

14. How to get the handle of focused window    coderanch.com

15. Two focused window at the same time    coderanch.com

In my project, I have a server running at localhost, javascript will send a request to localhost server which will open a Dialog window. The problem is I want the new Dialog window to get the focus, but what it happened is both browser (firefox) and dialog get the focus at the same time. I say that because both window's title ...

16. how to let swt window without focus?    coderanch.com





18. switch focus to another window    java-forums.org

If you want to control another application in windows you need to study Remote method induction....but if your java application window is the one you want to see the toFront() method works and you need to decide if it is modable or not...if it is a container. I don't believe you understand the principles of giving commands to exterior applications within ...

19. Forcing Window Focus with Swing Components    forums.oracle.com

Hello, I am having some trouble. I have a JFrame window open, and when the user hits a button, I want to display a new JFrame (keeping the old one open), but make it so that the old JFrame is not accessible until the new one is disposed of. Is there any specific function to force focus? Thanks.