Preventing a window of getting the focus

Hi,
I am pretty new to Java and at the moment I have a pretty big problem with the focus. Is it possible to prevent a window from getting the focus? I.e. an application has some kind of "properties" popup. So I don't want to make it impossible for the main window to get the focus until the user closes the "property"-window...
some hint or even example code would be great!

I am pretty new to Java and at the moment I have a pretty big problem with the focus. Is it possible to prevent a window from getting the focus? I.e. an application has some kind of "properties" popup. So I don't want to make it impossible for the main window to get the focus until the user closes the "property"-window...
When you open your properties window you could call setEnabled(false) on the frame that should not be able to get focus and call setEnabled(true) when the user closes the properties window. You will have to pass a reference to the frame to the properties window so that the window can then do yourFrame.setEnabled(false) when it's being closed.

Similar Messages

  • How to Get the focus of the textbox.

    Hi all,
    I have a problem in getting the focus of the textbox, The scenario is in this way,
    I have 3 textboxes in a window, each one should should get enabled one after the other only (i.e) Textbox2 should be enabled only after Textbox1 is filled and pressed the TAB button and Textbox3 is enabled only after Textbox2 is filled and pressed the TAB button. Textbox2 is also enabled when the cursor is in Textbox3 and SHIFT+TAB is pressed,
    I tried this with the Focus Listener but i cant able to get the cursor in the textbox. Please help in this, how to do this.
    Thanks in Advance.

    844031 wrote:
    Hi all,
    I have a problem in getting the focus of the textbox, The scenario is in this way,
    I have 3 textboxes in a window, each one should should get enabled one after the other only (i.e) Textbox2 should be enabled only after Textbox1 is filled and pressed the TAB button and Textbox3 is enabled only after Textbox2 is filled and pressed the TAB button. Textbox2 is also enabled when the cursor is in Textbox3 and SHIFT+TAB is pressed,
    I tried this with the Focus Listener but i cant able to get the cursor in the textbox. Please help in this, how to do this.
    Thanks in Advance.Hello user,
    If you are talking about 'TextBox' of javafx then please start a new thread on Javafx Category here:JavaFX 1.x and JavaFX Script [ARCHIVE]
    Thanks.,
    narayan

  • Setting focus outside a control when no other control can get the focus

    Hello
    I'd like to know if there is a way to setfocus outside of a control even if there is no other control to receive the focus.
    I have an editbox that has the focus (active) and I want to set visible to false to this control., but I cannot since it has the focus and there is no other controls that can get the focus.
    As a temporary measure I've added another editbox that I moved outside of the visible interface to which I've moved the focus. But I would like to know the proper way to do this.
    Thank you for your help.

    I think you are asking how to bring a windows form to the front.
    If not I apologize...
    The way I have done this:
    1. I created a new thread.
    2. I maxmized the window
    I set the following properties:
    ShowInTaskbar = False
    TopMost = True
    Focus()
    BringToFront()
    In all my testing I needed the window to be maximized, if it wasn't B1 stayed on top.

  • Popup - how to get the focus in a specific compent

    Hi,
    I am trying to get the focus of my pop-up in the second component.
    Use case: New button in the table shows a popup to get the input from the user. There is a Undo Edit link (top-left) to discard changes, on top of the pop-up so by default the focus goes to the top left. I have input text boxes under that. And I am trying to get the focus (mouse cursor) in the first input text box rather than the undo Edit link. Any idea to implement that without using javascript ?
              <af:popup id="newPopup" contentDelivery="lazyUncached"
                        popupCanceledListener="#{commonUtils.CreatePopupCanceledListener}">
                <af:dialog id="createPopupDL" type="none"
                           title="#{viewcontrollerBundle.NEW_COURSE_PLAN_STRUCTURE_QUALIFIER_HEADER}"
                           resize="on">
                  <af:separator id="s1"/>
                  <af:panelGroupLayout id="pgl2" layout="vertical" halign="left">
                    <af:panelGroupLayout id="pgl3" layout="horizontal">
                        <!-- csc:undoEdit is a custom component to undo change
                        By default the focus is coming to this component -->
                      <csc:undoEdit id="ue1"/>
                    </af:panelGroupLayout>
                    <af:messages id="m1"/>
                    <af:spacer width="10" height="10" id="s2"/>
                    <af:panelFormLayout id="pfl1" labelAlignment="start"
                                        labelWidth="140">
                      <af:spacer width="10" height="10" id="s3"/>
                          <!-- I want to get my mouse cursor in this box -->
                          <af:inputText id="it2"
                                    label="#{bindings.QualifierCd.hints.label}"
                                    value="#{bindings.QualifierCd.inputValue}"
                                    showRequired="true"
                                    required="#{bindings.QualifierCd.hints.mandatory}"
                                    columns="#{bindings.QualifierCd.hints.displayWidth}"
                                    maximumLength="#{bindings.QualifierCd.hints.precision}"
                                    shortDesc="#{bindings.QualifierCd.hints.tooltip}"
                                    autoSubmit="true">
                        <f:validator binding="#{bindings.QualifierCd.validator}"/>
                      </af:inputText>
                    </af:panelFormLayout>
                  </af:panelGroupLayout>
                  <af:spacer width="10" height="10" id="s4"/>
                  <af:separator id="s5"/>
                  <f:facet name="buttonBar">
                    <af:group id="g2">
                      <af:panelGroupLayout id="pgl4" layout="horizontal"
                                           halign="start">
                        <af:commandButton text="#{smsCommonViewBundle.CreateBtn}"
                                          id="createCB" action="doCommit"
                                          partialSubmit="true"
                                          accessKey="#{smsCommonViewBundle.CREATE_ACCESS_KEY}">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                        </af:commandButton>
                        <af:spacer width="10" height="10" id="s6"/>
                        <af:commandLink text="#{smsCommonViewBundle.CANCEL_LNK}"
                                        id="cancelCL" action="doCancel"
                                        accessKey="#{smsCommonViewBundle.CANCEL_ACCESS_KEY}"
                                        immediate="true">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                          <af:resetActionListener/>
                        </af:commandLink>
                        <af:spacer width="400" height="10" id="s9"/>
                        <af:icon name="required" id="i1"/>
                        <af:spacer id="sp3" width="5" height="0"/>
                        <af:outputText value="#{smsCommonViewBundle.requiredLbl}"
                                       id="ot1" styleClass="requiredText"/>
                      </af:panelGroupLayout>
                    </af:group>
                  </f:facet>
                </af:dialog>
              </af:popup> Edited by: user9319679 on Sep 6, 2011 10:43 AM

    I dont think so that possible without javascript.. AFAIK
    <af:clientListener method="setFocus()" type="load"/>
          <af:resource type="javascript">
               function setFocus(event){
                 var input1 = document.getElementById('pt1:r1:3:pt1:it1::content'); // the complete id of the inputText - change it according to your jsff.. use firebug to get the proper id
                 if(input1!=null)
                 {input1.focus();
          </af:resource>

  • How to get the focus in a Table Control

    Hello Experts,
                         I have a simple Table control in my screen . I want to know under which column my cursor is ? Basically i want to get the focus the table control . How can i achieve this  ?
    Thanks
    Vivek

    >
    Vivek Joshi wrote:
    > Hello Router ,
    >                      I do not want to set the focus , I want to get focus . User can click on any cell in the table and then press a button in the toolbar . Now in the event handler of the button i want to under which column User has set the focus .
    > I hope , I am clear now .
    > Thanks for your help
    > Regards
    > Vivek
    An yet you keep getting suggestions of how to set the focus.   I looked through the API documentation and I don't see anything that would suggest you can request to see where the current focus is.  Perhaps someone might still come along with a solution, but my hopes wouldn't be too high at this point.  I can pass the requirement onto Product Definition, as the use case does seem interesting.  Perhaps it is something we have even considered in the past. 
    But for now, there might be a better way to solve your problem.  It will probably mean redesign the interaction.  What exactly are your requirements?  Do you need to be able to get the data in a particular cell of table when a button is clicked?  Just throwing out some ideas here, but maybe just use the lead selection to select the row, but then have a button choice to choose the action associated with the column you want. A hack for sure - but it might work.  Also it doesn't help you right now, but in the near future update to NetWeaver 7.0, WDA does have a onColSelect event for the table.

  • How to get the focus at the end of text ?

    I am having applet with awt TextField component and some default text. (MSQ-)
    To have a focus to text field I am using :
    refnoTextField.requestFocus();
    But this gives focus at the biginning and not at the end of text. I want the focus at the end (i.e. after MSQ-)
    How to get the focus at the end of text ?
    any help ?
    manisha
    manisha

    public void focusGained(FocusEvent e) {
         if (e.getSource() == yourtextbox) {
         yourtextbox.setSelectedEnd(yourtextbox.getLength());
    try this thing - not sure if it'll work, but I figgured out how to apply it to my textareas for keeping the focus on the last line of the textarea..it might work for your textboxes..
    shrug

  • How to get the focus of particular UI Element

    Hi All,
    How to get the focus of particular UI Element in webdynpro Page,
    I have a page where i am creating a ALV, I want to get that keyboard focus is on that element is there or not?
    Can anyone please give some update?
    Best regards,
    Rohit

    I would suggest try invoking REFRESH of ALV on the ON_CELL_ACTION event.
    Below excerpt is from Thomas
    The Events of inner UI elements are not exposed directly as they normally would be if they were standalone. Generally you can capture them using either the
    ON_DATA_CHECK:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/frameset.htm
    This gets trigger for any press of ENTER, so it generally works like the Input Field onEnter.
    You could also consider ON_CELL_ACTION:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/45/12093591152464e10000000a1553f7/frameset.htm
    It is a higher level Event that encompasses both ON_DATA_CHECK and ON_CLICK.
    if you want to capture & refresh on some hot key combination then refer to this thread
    [https://www.sdn.sap.com/irj/scn/profile?editmode=true&userid=3760417]

  • When I start mozilla or open any link in a new window I get the desired page to load but an additional new tab page opens up along with it, fix?

    When I start mozilla or open any link in a new window I get the desired page to load but an additional new tab page opens up along with it. I've tried switching my homepage to different things (new tab, firefox home, show blank page) but I always get an additional new tab to open. How do I get only a single page to open?

    Hello,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. <br>
    '''Note''': ''This will cause you to lose any Extensions and some Preferences.''
    *Open websites will not be saved in Firefox versions lower than 25.
    To Reset Firefox do the following:
    '''For Firefox versions previous to 29.0:'''
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox"[[Image:Button reset]] button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    '''For Firefox 29.0 and above:'''
    #Click the menu button [[Image:New Fx Menu]], click help [[Image:Help-29]] and select ''Troubleshooting Information''.
    Now, a new tab containing your troubleshooting information should open.
    #At the top right corner of the page, you should see a button that says "Reset Firefox"[[Image:Button reset]]. Click on it.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Every time i try to install itunes on my laptop for windows  i get the message''key not valid for use in specified state''  any clue? '

    every time i try to install itunes on my laptop for windows  i get the message''key not valid for use in specified state''  any clue?

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\<User>\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • HT1925 I am having an issue with loading Itunes. I receive a missing dll file notice. Then another error message. I have reinstalled Windows & still get the error. I did not get the error until I recently did an ITunes update.

    I am having an issue with ITunes after a recent ITunes update. I can not open ITunes, I get a message missing MSVCR80.dll file, Then an error 7 message. I have redone the OS for Windows 7 and restarted the computer. I keep getting the errors.

    Do the following:
    Uninstall from Windows the following five programs: iTunes, Apple Software Update, Apple Mobile Device Support, Bonjour and Apple Application Support. You do this from an applet in Control Panel called Programs & Features (in Windows 8, 7, or Vista) or Add or Remove Programs (in Windows XP).
    Download the latest version of iTunes from Apple and note the location you're saving it to so you can find it once it's done.
    Run the iTunes installation as an administrator, just Right click iTunes installer and Run as Administrator.

  • HT1926 can't install quicktime or itunes on windows 7 get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run

    please help. Can't install quictime player or itunes on windows 7. Get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run. Have followed all the steps suggested and still no luck.

    thank you for trying to help. I do not have apple software update on my computer. I have tried to install several programs so i could install it but every installation will not finish and rolls back and says no changes were made to my computer so i can't install the update. I even tried to force install as administrator but nothing works. Any help would be greatly appreciated. I have windows 7 64 bit.

  • Get the focus on applet again if user switches between applications

    hi,
    How to set the focus on applet which runs in a browser(IE5.x) if user goes to another application and come back to the same applet. I am using JRE1.4 i have tryed it with using aapletname.requestFocus() in javascript but it looks requestFocus() has some problems.
    window.onfocus =document.helloApplet.requestFocus();
    or
    <script>
    function activated()
         document.helloApplet.requestFocus();
         return true;
    </script>
    <body LEFTMARGIN=0 TOPMARGIN=0 onFocus = activated();>
    <OBJECT name="helloApplet" classid="clsid:CA......................
    Any suggestions
    Thanks

    public void start()
    Called by the browser or applet viewer to inform this applet that it should start its execution. It is called after the init method and each time the applet is revisited in a Web page.
    I can't invoke init method as it is called once only.So it won't help

  • To get the focus to a JTextField

    Hi,
    In my project,I am using a JFrame as a background .And I put a JDeskotppane.On that pane i put JInternalFrame.
    My JInternalFrame contains so many JButtons and JTextFields.
    My need is when I run the project the focus sholud be in my first JTextField.But the focus automatically goes to the JButton which is my first component.
    I try with following methods.
    jTextField1.requestFocus()
    jTextField1.requestFocusInWindow().
    But not .Is ther any way to do it?
    Thank you so much.
    Meena.

    Hi,
    Thank you so much.
    I write the coding of
    jTextField1.requestFocusInWindow() in Window Activated event.
    I got the result I want.
    The link given by you is very useful to me.
    Thank you so much
    Meena.

  • JRadioButton not getting the Focus Back

    Hi,
    I am having a problem with the RadioButtons. I have a panel and have three radio buttons belonging to a group. I have selected the third button and saved it to the database. When I came back to the panel, I have the third button selected.But the focus( Rectangle around the text) is on the first button. If I click on the third button then the focus came to the third button. I tried using requestFocus() but its not at all working. Some one please help me asap.
    Example of Code...
    if(selButton =1)
    rb1.setSelected(true);
    else if(selButton = 2)
    rb2.setSelected(true);
    else
    rb3.setSelected(true);
    TIA,
    CK

    Did you try:
    if(selButton =1) {
      rb1.setSelected(true);
      rb1.requestFocuse();
    } else if(selButton = 2) {
      rb2.setSelected(true);
      rb2.requestFocuse();
    } else {
      rb3.setSelected(true);
      rb3.requestFocuse();
    }Doesn't work ?

  • JRadio Button not getting the  focus back

    I am having a problem with JRadio Button. I have three buttons in a Panel and I display three different set of sub panels on selecting the corresponding radio button. The top most button is the default one. I selected the second button and saved it to the database. When I come back to the screen, I have the second button selected.But the focus(the rectangle around the text) is on the first button. When I again click on the second button then the focus is coming to the second button. I tried almost everything( requestFocus() etc.,). Can some one help me.
    TIA,
    CK

    Hi!
    Here's some code for simulating your application -- as far as I could understand what it was aimed for... ;-)
    Try this code and let me know...
    (it's a bit long but just paste it)
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    public class Test extends JFrame
    ButtonGroup bg;
    JRadioButton jrb1;
    JRadioButton jrb2;
    JRadioButton jrb3;
    JPanel panel;
    MyItemListener mil = new MyItemListener();
    public Test()
    setSize(600,400);
    Container cp = getContentPane();
    cp.setLayout(null);
    bg = new ButtonGroup();
    jrb1 = new JRadioButton("button 1");
    jrb1.setBounds(10, 10, 200, 20);
    jrb2 = new JRadioButton("button 2");
    jrb2.setBounds(10, 35, 200, 20);
    jrb3 = new JRadioButton("button 3");
    jrb3.setBounds(10, 60, 200, 20);
    bg.add(jrb1);
    bg.add(jrb2);
    bg.add(jrb3);
    JPanel pan = new JPanel();
    pan.setLayout(null);
    pan.setBounds(40, 40, 220, 90);
    pan.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
    pan.add(jrb1);
    pan.add(jrb2);
    pan.add(jrb3);
    cp.add(pan);
    panel = new JPanel();
    panel.setLayout(null);
    panel.setBounds(280, 40, 200, 90);
    panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
    cp.add(panel);
    jrb1.addItemListener(mil);
    jrb2.addItemListener(mil);
    jrb3.addItemListener(mil);
    public static void main(String[] args)
    (new Test()).setVisible(true);
    class MyItemListener implements ItemListener
    public void itemStateChanged(ItemEvent e)
    Object source = e.getSource();
    if (source == jrb1)
    jrb1_itemStateChanged(e);
    else if (source == jrb2)
    jrb2_itemStateChanged(e);
    else if (source == jrb3)
    jrb3_itemStateChanged(e);
    public void jrb1_itemStateChanged(ItemEvent e)
    if (jrb1.isSelected()){
    Color color = Color.red;
    panel.setBackground(color);
    // THIS JDIALOG BOX SIMULATES FRAMES THAT MIGHT POP UP
    // DURING DATABASE TRANSACTIONS...
    //======================================================
    JDialog jd = new JDialog();
    jd.setSize(400,300);
    jd.setModal(true);
    jd.getContentPane().setBackground(color);
    jd.setVisible(true);
    public void jrb2_itemStateChanged(ItemEvent e)
    if (jrb2.isSelected()){
    Color color = Color.green;
    panel.setBackground(color);
    // THIS JDIALOG BOX SIMULATES FRAMES THAT MIGHT POP UP
    // DURING DATABASE TRANSACTIONS...
    //=======================================================
    JDialog jd = new JDialog();
    jd.setSize(400,300);
    jd.setModal(true);
    jd.getContentPane().setBackground(color);
    jd.setVisible(true);
    public void jrb3_itemStateChanged(ItemEvent e)
    if (jrb3.isSelected()){
    Color color = Color.yellow;
    panel.setBackground(color);
    // THIS JDIALOG BOX SIMULATES FRAMES THAT MIGHT POP UP
    // DURING DATABASE TRANSACTIONS...
    //======================================================
    JDialog jd = new JDialog();
    jd.setSize(400,300);
    jd.setModal(true);
    jd.getContentPane().setBackground(color);
    jd.setVisible(true);
    cbmn2

Maybe you are looking for

  • "Change country" button not working on iPad mini

    I need to change my apple ID's country on my ipadmini. I already tried tapping settings>itunes and appstore>view apple ID>change country, but no country list is displayed at all to choose from. Does anyone know of an alternative method?

  • When I connect to a personal hotspot via bluetooth it disconnects the wifi on the serving device, why?

    I know this has been working before, and I really need to connect my iPad via Bluetooth to my iPhone so that I can then use the Wireless via my iPhone. Unfortunately, every time I connect to the iPhone via Bluetooth the WiFi on the iPhone disconnects

  • Problems with Excel 2007 and Essbase 6.5

    Hi, Two quick questions: 1. We are planning to upgrade our office to 2007, XP professional SP2 but still going to use Essbase excel add-in 6.5 for some users and Essbase 7.3 add-in for others. Has anyone faced any problems with this combination? 2. T

  • Pricing in CRM

    Hi All, What is the difference between Pricing in CRM 2007 and Pricing in CRM 5.0? Thanks Sonali

  • Color calibration problems on mac pro

    I have a bunch of quicktimes I captured via firewire from a 1200a deck. These quicktimes I converted to Quicktime PNG via compressor so they could be opened on a PC as well. When I open the exact same quicktime file on PC it appears much brighter tha