How do I center a child window in the parent when it loads

I want to open a window and have it start up centered in the parent window. What's the best way?
Thanks in advance for the help.

I can't make it work. I can't find a method setLocationRelativeTo() either. What class contains that method?

Similar Messages

  • Accessing variables from Child window from the parent window

    Hi All,
    I am in the process of integration of payment gateway, here I am opening payment gateway page as a new window, and after payment is done then I need access one variable which is hidden variable ...any ideas

    Have a hidden field/js variable in the parent page. Add a Javascript function in parent page which would take a value as parameter and set in the parent page hidden field/js variable. In the child window, you can invoke the method from script block as window.opener.setValue(document.getElementById('CHILD_WINDOW_HIDDEN_FIELD_ID').value)
    For Javascript related questions, please visit Javascript forums.

  • How to parse parameter from child window to parent window in JSP

    I have two JSP i.e. course1.jsp and course2.jsp. I would want to find out how I could parse the parameter/value from child window to the parent window when the child window get closed.
    What I am trying to do is actually a file upload process. The child windows will open for user to upload the file, and when close, the file name will be parse into the parent form for database update. Is this something possible at all? or is there any other better approaches.
    Thank you.
    These are the two files:
    --------course1.jsp ------------
    Attach File <p>
    <FORM name="courseForm" action="course2.jsp" method="post" enctype="multipart/form-data">
    <TABLE cellSpacing=1 cellPadding=3 border=0 WIDTH=500>
    <TR >
    <TD>
    <input type="text" NAME="f_file_name" size="30" VALUE="this value should be taken from child windows">
    get file name
    <p>
         <INPUT class="buttons" TYPE="submit" NAME="submit" VALUE="Submit">
    </TD>
    </TR>
    </TABLE>
    </FORM>
    ---- course2.jsp -------
    <%
    String filename = "this is the string needs to go back to parent windows when I click on close";
    %>
    <p>
    close

    In course2.jsp, you have to write some javascript code to reload the parent window document to reload the document with an added parameter. But, instead of doing this, you can also do simple thing; in course2.jsp, you can reference course1.jsp controls via javascript object, "parent". On closing event of course2, you can write:
    parent.courseForm.f_file_name.text = '<%=filename%>' ;
    window.close() ;
    But for this to work, you must open your course2.jsp document thru window.open() function instead of simple hyper link (as you did thru ).
    So, modify the hyperlink line like below:
    get file name
    Hope it helps.

  • Call new window with the parent to be frozen blur

    hi,,
    please suggest me how we will call a new window while the parent window will get to frozen or blur...and the child windows border should not be visible and it has similar look as like a popup.
    Thanks and Regards,
    Muthu..

    Which jdev version do you use?
    A glass pane might be what you are looking for http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf
    Timo

  • Swing: how do I launch a child window?

    How do I open a child window or frame, get the user input on this window, and return to the parent window? I know JOptionPane has some static methods that triggers message windows, but they're too simple to meet my needs.
    What lines of code should I write in the parent window (JPanel/JFrame)? And what object should I create for the child window? Thank you!

    JDialog d = new JDialog(f, "Enter something!", true);
    // assuming f is a reference to the main JFrame
    // fill with whatever GUI
    d.pack();
    d.show();
    // will block til closed...
    // read in filled data...
    You can do more in JOptionPane then is suggests. If you want some complex GUI to enter different things, do the JDialog thing. If you just want one value, you can do something like this:
    JPasswordField pwd = new JPasswordField();
    Object[] objs = { "Enter password:", pwd };
    if(JOptionPane.showConfirmDialog(this, objs, "Enter password",
              JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.PLAIN_MESSAGE) == JOptionPane.CANCEL_OPTION) {
         return; // cancelled
    } else {
       String pass = new String(pwd.getPassword());
       // use it...
    }

  • How To create a JFrame child window

    Hi guys,
    for the first time I'm trying to develop a java application with GUI using NetBeans.
    I've created three Jframe classes and i want to set two of these as child-windows on the Main class but I couldn't find how to do this.
    public class Main extends javax.swing.JFrame {
        /** Creates new form Main */
        public Main() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            Vob_Butt = new javax.swing.JButton();
            MCoder_Butt = new javax.swing.JButton();
            jLabel1 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("AsfConverter 0.6");
            Vob_Butt.setText("Unire pi\u00f9 file Vob");
            Vob_Butt.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    Vob_ButtActionPerformed(evt);
            MCoder_Butt.setText("Convertire file con MediaCoder");
            MCoder_Butt.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    MCoder_ButtActionPerformed(evt);
            jLabel1.setText("Cosa vuoi fare?");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(110, 110, 110)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(Vob_Butt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                        .addComponent(MCoder_Butt, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(83, 83, 83))
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(263, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(39, 39, 39)
                    .addComponent(jLabel1)
                    .addGap(14, 14, 14)
                    .addComponent(Vob_Butt)
                    .addGap(31, 31, 31)
                    .addComponent(MCoder_Butt)
                    .addContainerGap(189, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void MCoder_ButtActionPerformed(java.awt.event.ActionEvent evt) {                                           
    // TODO add your handling code here:
            MediaCoder finestraCoder=new MediaCoder();
            finestraCoder.setVisible(true);
        private void Vob_ButtActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
            VobUnifier finestraVob=new VobUnifier();
            finestraVob.setVisible(true);
            this.setVisible(false);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Main().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JButton MCoder_Butt;
        private javax.swing.JButton Vob_Butt;
        private javax.swing.JLabel jLabel1;
        // End of variables declaration                  
    //****this class may be a child of the upper one
    public class VobUnifier extends javax.swing.JFrame {
        File []source;
        File dest;
        /** Creates new form VobUnifier */
        public VobUnifier() {
            source=null;
            dest=null;
            initComponents();
      private void formWindowClosed(java.awt.event.WindowEvent evt) {                                 
        Main finestraMain= new Main();
        finestraMain.setVisible(true);   
    public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new VobUnifier().setVisible(true);
    // The third class has the same constructor of this one and similar methods    I hope to have explained the problem.
    Thanks for your help!
    Edited by: Il_cimi on Nov 12, 2007 3:45 AM

    camickr wrote:
    -> Can I insert buttons, labels etc.. in a Jdialog windows like a Jframe one or there's some limitations?
    Now how long would it take to try it?
    How do you ever learn anything if you don't try it on your own?I said that I' ve already solved my problem, you suggested me to use JDialog and I just wanted to know what's the difference. I didn't try in my own just because i'm trying to solve quickly other problems.
    I will try it when i can

  • How to pass the data from a pop up window to the parent window

    Hi All,
    I have a jsp page which contains a add button, while clicking it a popup will come out(which is a another jsp page). There are some input fieldsand a submit button. Now how could I send the data from the pop up to the parent winow. Also I have to check that if the pop up is open and I click add button then another pop up must not open.
    Plz reply its urgent
    Thanks and Regards
    Rajib Sharma

    Thanks for the reply
    But it not worked
    I have a jsp page and the popup is also a jsp page the data that is passed from the popup window to the parent must be send to the server from the parent window to get a data from the data base as search result. Its of no use to get it as js data
    Thanks and regards
    Rajib Sharma

  • How can I run 2 Dreamweaver windows at the same time?

    How can I run 2 Dreamweaver windows at the same time on my
    PC?
    basically I have 2 monitors and I want to edit CSS on one
    monitor and have the html page open on the other so I can quickly
    look from one to another with in a split second instead of taking
    that extra time to switch back and forth using the tabs at the top,
    I know I should probably invest into a mac so i can work out side
    of the Dreamweaver application window and I will in the future but
    is there any way i can do this on my windows XP pro PC?
    Thank you
    Maurice

    Open the CSS in DW, and use F10 to open the Code Inspector.
    Place the
    latter as needed.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Random_Yggdrasil" <[email protected]> wrote
    in message
    news:gi2htb$j4j$[email protected]..
    > How can I run 2 Dreamweaver windows at the same time on
    my PC?
    > basically I have 2 monitors and I want to edit CSS on
    one monitor and have
    > the
    > html page open on the other so I can quickly look from
    one to another with
    > in a
    > split second instead of taking that extra time to switch
    back and forth
    > using
    > the tabs at the top, I know I should probably invest
    into a mac so i can
    > work
    > out side of the Dreamweaver application window and I
    will in the future
    > but is
    > there any way i can do this on my windows XP pro PC?
    >
    > Thank you
    > Maurice
    >
    >
    >

  • Move data from Child window textbox to Parent window Mainwindow WPF

    I'm trying to take what's in a textbox in the child window to the textbox in the Parent window and close the child window...? any links or  a code example to help please
    Thank you in advance

    Hi
    Create a Main window with a button and a child window with a text box in it and try to use this code in the main window
    namespace WpfApplication
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    ChildWindow childWindow;
    string CaptureMessageFormChildWindow;
    private void button1_Click(object sender, RoutedEventArgs e)
    childWindow = new ChildWindow();
    childWindow.Show();
    childWindow.Closed += (s, args) => MessageBox.Show(childWindow.textBox1.Text);
    CaptureMessageFormChildWindow = childWindow.textBox1.Text;
    //Now you can use the data captured form the child windows
    The complexity resides in the simplicity Follow me at: http://smartssolutions.blogspot.com

  • If u open child window that time parent window close?

    hi to all,
    if u open child window that time parent window close?
    regards
    welcanv

    hi,
    not sure what you mean here but a child window cant 'lose' its parent. If the parent dies/doesn't exist the same happens for the child.
    David.

  • How to Use Messge-Pool of Child DC, in the Parent DC

    Hi,
    I am trying to achieve componentization of webdynpro projects.
    I want to use the messages stored in the Messge-Pool of child DC, in the parent DC.
    I have done the following so far:
    I have stored all the messages(error/standard) in the message pool of one DC project.
    I have created the public part of the component of that DC.
    I have Build-deploy-checkin that DC project.
    I have added that public part to another DC.
    I have successfully added it to the "used Webdynpro components" of the second DC.
    I am able to successfully pass values using context mappings, between the two DCs.
    But i am not able to use the Messges available in th message-pool of the first(child) DC.
    I added the childDC to the properties of the Views of the second(Parent) DC, but i am still not able to use the Messages present in the Messagepool of the child DC.
    Is there a way to use the Messages present in the Messagepool of the child DC, in the views of the parent DC???
    Thanks,
    Hanoz

    Hello,
    You have to use EXPORTING LIST TO MEMORY AND RETURN addition with SUBMIT stmt.
    Try like this:
    DATA:
    L_IT_LIST TYPE STANDARD TABLE OF ABAPLIST.
      SUBMIT <Child Program Name>
      WITH SELECTION-TABLE LIT_RSPARAMS
      EXPORTING LIST TO MEMORY AND RETURN.                   "#EC CI_SUBMIT
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          LISTOBJECT = L_IT_LIST
        EXCEPTIONS
          NOT_FOUND  = 1
          OTHERS     = 2.
      IF SY-SUBRC = 0.
        CALL FUNCTION 'WRITE_LIST'
          TABLES
            LISTOBJECT = L_IT_LIST
          EXCEPTIONS
            EMPTY_LIST = 1
            OTHERS     = 2.
        IF SY-SUBRC <> 0.                                       "#EC *
    *     Do Nothing
        ENDIF.
    Hope this is clear.
    BR,
    Suhas

  • I just bought a Macbook Air and a usb super dive.  How do I install MS Office 2003 on it?  It won't launch the install when I load the disk in the superdrive.

    I just bought a Macbook Air and a usb super dive.  How do I install MS Office 2003 on it?  It won't launch the install when I load the disk in the superdrive.

    A 2003 MS office sounds like a Windows version.  A 2004 MS Office that was Mac compatible can not be run natively on a new MBA since the Lions do not run PPC applications.  You will have to get a newer edition of MS Office that is compatible with your new MBA.
    Ciao.

  • How do I share a hard drive with the new iMac to load a disk from macbook pro

    How do I share a hard drive with the new iMac to load a disk from macbook pro. I want to install office for Mac from a disk but dont know how to share har drive from macpro
    thanks

    The new iMac's don' t have DVD drives however almost all have a disk drive. The easiest method of installing MS Office for Mac on your new iMac is to download it from Microsoft and then input the code you received when you purchased your original license. Otherwise you can use the DVD drive on your MBP to install on your iMac, that feature is called Remote Disc. Instructions for Remote Disc can be found at:http://support.apple.com/kb/ht5287

  • How can I stop receiving email automatically from the community when they have issues with there problems regarding the apple products.

    How can I stop receiving email automatically from the community when they have issues with there problems regarding the apple products.

    Click here for the instructions on stopping the emails.
    (85713)

  • How to launch a function/procedure without suspending the parent process?

    Hi everybody,
    I would like to know if I can define something as follows in PLSQL:
    procedure master
    begin
    call a procedure_child;
    End master;
    I would like that the procedure master does not suspend the execution and wait that the procedure_child finishes in order to resume the executions with the further code.
    Thanks a lot in advanced
    Tomeu

    In the future, please stick to posting in a single forum.
    Re: How to launch a function/procedure without suspending the parent process?

Maybe you are looking for