How to make my child windows in the center of the screen?

Center Screeen Problem..

can always use the getScreenSize() and setLocation() methods to properly place your component
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension componentSize = yourComponent.getSize();
    if (componentSize.height > screenSize.height) {
      componentSize.height = screenSize.height;
    if (componentSize.width > screenSize.width) {
      componentSize.width = screenSize.width;
    yourComponent.setLocation((screenSize.width - componentSize.width) / 2,
                             ((screenSize.height - componentSize.height) / 2);of course youll have to adjust the width and height when setting the location cuz this will place the top-left corner of your component at the center of the screen, not the exact center of it.

Similar Messages

  • In windows 7, how to make firefox start automatically when I turn on the computer

    In Windows 7, how to make Firefox start automatically when I turn on the computer. Note, I am asking how to do this with Windows 7, not xp, not vista.

    You need to place a shortcut to open Firefox in the Start > Programs > Startup folder.<br />
    That is basically the same in all Windows versions.

  • How to create a Child Window without closing the parent Window

    Hi All,
    I have a requirement to create a child window without closing the parent window. I have to click an item in the parent window, then one child window should get open. The parent window should not be closed before closing the child window.
    Kindly help me in this.
    Thanks and Regards,
    Myvizhi

    Hi All,
    I found the solution for this. I have created a new page. Then i created an item as link item style in the parent page and i have set the following properties in the Link item:
    Destination URI : OA.jsp?page=/seagate/oracle/apps/seasoa/que/webui/SeaSoaHeaderDetailPG&headerId={@ErrHeaderId}&retainAM=Y&addBreadCrumb=Y&backPage=S
    Target Frame     : _blank
    This is opening the new child window without closing the parent window.
    Thanks and Regards,
    Myvizhi

  • How to make IIS on Windows 7 visible from outside my home LAN

    Guidance Needed: How to make IIS on Windows 7 visible from outside my home LAN.
    I am building a learning/demo ASP.NET website on this Win7 PC, using VS2008. 
    I would like to share the website with a client/friend, so I need my local IIS to be visible from outside the home LAN.
    This PC is behind a Netgear WGR614 router, which has a static IP address assigned by my ISP. 
    I have set up port forwarding on the router; port 80 is HTTP.
    I can see the website as http://localhost/ and also as http://192.168.0.2 from other PCs inside the LAN.
    Ping works from outside, but not http.   What am I missing?

    Hi,
    Since this question is related to IIS and we have specific support for IIS related issues or questions, it is also recommended that you go to IIS Forum for help.
    Hope this helps. Thanks.
    Nicholas Li - MSFT

  • How to make movies open in the center of my screen.

    Does anyone know how to make Quicktime open up videos in the center of a screen? When I double click any movie file it pops open in the uppermost far left corner, and I have to drag it down into a more comfortable area. It's annoying with a large monitor.
    Thanks
    noodle--head

    The script writing lobe of my brain was damaged by years of drug abuse, years ago. Try as I might, I can't seem to get it right.
    The most common error I get is:
    Expected end of line, etc. but found “end tell”.
    I tried modeling one of any number of existing scripts but still no dice.
    I tried this:
    tell application "QuickTime Player"
    activate
    set the bounds of window 1 to {235, 58, 944, 590}
    end tell
    And got this error message: QuickTime Player got an error: NSReceiverEvaluationScriptError: 4
    I know this is simple but, like I said...
    nnooo-dlehead ssslowto catchon

  • How to make a select list editable or searchable like the combobox

    Does anybody know, How to make a select list editable or searchable like the combobox? Do we need a plugin here, where I can get it.

    Hi Nilesh,
    If this is what you are looking for http://apex.oracle.com/pls/apex/f?p=32395:3:1202144397644679
    get the combobox plug-in
    http://www.apex-plugin.com/oracle-apex-plugins/item-plugin/searchable-combobox.html
    I have not tried this though. Found it while searching for some other plug-ins.
    Regards,
    -Senthil

  • How can i use both Windows and Mac os at the same time on my iMac

    How can i use both Windows and Mac os at the same time on my iMac

    You can use Parallels desktop or VM Fusion to run both operating systems at the same time. Both programs work well, but I personally perfer VM Fusion.

  • How to make a summary column appear only once (in the first page only) in SSRS 2008?

    Hello Everyone,
    How to make a summary column appear only once (in the first page only) in SSRS 2008?
    Regards
    Gautam S
    Regards

    Hi,
    Assuming you have test data like this ;
    select 'abc'as [GROUP],'NN' name , 1 id
    union all
    select 'abc' as [GROUP] ,'PP' name , 1 id
    union all
    select 'abc'as [GROUP],'RR' name , 2 id
    Step1  : take Tablix with row group as your group Name .
    Step2 : right Click on Row Group Details -> Delete-> Delete Group Only
    Step3 : In Count Cell use below expression ;
    =CountDistinct(Fields!id.Value)
    Follow this link;
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b6b45917-0a26-4d15-be46-2c6a2697d6e9/distinct-rows-sum?forum=sqlreportingservices#5ffdee06-c2c8-44ea-a3a5-b958488bb6b5
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • How to put the main windows in the center of the screen

    Hello
    I want that first windows appears in the center of the screen. Anyone can say, look at screen size and calculate it, but I don't know what it be the size of the screen when app will run, it depends of computer.
    Thank in advance !

    var screenBounds:Rectangle = Screen.mainScreen.bounds;
    This will give you information about the screen. You can access the height/width using screenBounds.height and screenBounds.width.

  • How to make a Quicktime 7 video open in the center of the screen. Answered!

    I open a Quicktime video and then noticed that the video didn't open in the top left top corner of the screen, like they usually do. So I placed the video in the center of the screen and did a SAVE, then closed the video. When I the video opened again it open to where I placed the video, the center. Then I placed the video on my second screen, center. Did a save and then close the video. When I reopened the video it open on the second screen centered....................! I don't know if this happens because of my OS (10.5.8) or Quicktime 7.6.4. But it works!!! People have been asking for years how to open a Quicktime video in the center of the screen. But there hasn't been an answer or a fix on how to do this, until now...! If you do a SAVE AS you can't over write the video you need to rename the video.
    Footnote: If you do a SAVE to Quicktime video. The video will lose the FAST START feature. If you need the fast start feature you need to do a SAVE AS. SAVE AS places the fast start feature back into the video. Fast start is used for videos that are posted on the internet.
    Message was edited by: David M Brewer

    Hi there
    What version of Captivate?
    Typically there is an option to click just to the right of where you type the URL.
    Below is an image of the version 5 properties.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How to print the JFrame In The Center Of The Page?

    hi there in the following code iam trying to print a JFrame
    but the frame appear in the printed page at the top left
    and i want it to appear in the top center of the page
    how to do that?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.print.*;
    class PrintUIWindow implements Printable, ActionListener {
        JFrame frameToPrint;
        public int print(Graphics g, PageFormat pf, int page) throws
                                                            PrinterException {
            if (page > 0) {
                return NO_SUCH_PAGE;
            Graphics2D g2d = (Graphics2D)g;
            g2d.translate(pf.getImageableX(), pf.getImageableY()-55);
            frameToPrint.print(g);
            return PAGE_EXISTS;
        public void actionPerformed(ActionEvent e) {
             PrinterJob job = PrinterJob.getPrinterJob();
             job.setPrintable(this);
             boolean ok = job.printDialog();
             if (ok) {
                 try {
                      job.print();
                 } catch (PrinterException ex) {
        public PrintUIWindow(JFrame f) {
            frameToPrint = f;
        public static void main(String args[]) {
            UIManager.put("swing.boldMetal", Boolean.FALSE);
            JFrame f = new JFrame("Print UI Example");
            f.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {System.exit(0);}
            JLabel label1=new JLabel("Selling Bill",JLabel.CENTER);
            JLabel label2=new JLabel("Customer Name :Mahmoud Saleh       ",JLabel.LEFT);
            JLabel label3=new JLabel("Buying Date :29/8/2008             ",JLabel.LEFT);
            JLabel label4=new JLabel("Book Buyed :Java Printing          ",JLabel.LEFT);
            JLabel label5=new JLabel("Number : 6 Copies                  ",JLabel.LEFT);
            JLabel label6=new JLabel("Total Price :600 $                 ",JLabel.LEFT);
            label1.setFont(new Font("Courier New", Font.BOLD, 13));
            label2.setFont(new Font("Courier New", Font.BOLD, 13));
            label3.setFont(new Font("Courier New", Font.BOLD, 13));
            label4.setFont(new Font("Courier New", Font.BOLD, 13));
            label5.setFont(new Font("Courier New", Font.BOLD, 13));
            label6.setFont(new Font("Courier New", Font.BOLD, 13));
            JButton printButton = new JButton("Print This Window");
            printButton.addActionListener(new PrintUIWindow(f));               
            JPanel panel=new JPanel();
            panel.setLayout(new GridLayout(6,1));
            panel.add(label1);
            panel.add(label2);
            panel.add(label3);
            panel.add(label4);
            panel.add(label5);
            panel.add(label6);
            f.setSize(300,300);       
            f.setLocationRelativeTo(null);       
            f.add(panel,BorderLayout.CENTER);
            f.add(printButton,BorderLayout.SOUTH);
            panel.setBackground(Color.WHITE);
            f.setResizable(false);
            f.setVisible(true);
    }

    First_knight wrote:
    please tell me am i thinking right
    about this method: setImageableArea(.....)
    public void setImageableArea(double x, double y,  double width, double height);
    like I said, I've tried this method and it doesn't seem to do anything.
    the width=the JFrame Width,the height=the JFrame Height right?actually, when printing, 72 points (printing version of pixels) = 1 inch, so to do WYSIWYG, you need width = JFrameWidth * 72.0 / Toolkit.getToolkit().getScreenResolution. Ditto with height
    upper left beginningx(0)---------------------------200--------------------------------600-----------------------------------y(1000)upper right beginningyou need to do something like PageSetup.getImageableX and do Graphics.translate(x,y);
    also, if your page width = 720, that = 10 inches - that's a wide page (unless its in landscape)
    so if i want the JFrame To Be In The Center Of The Page I Would Choose From x=200 ,y=600 depending that frame width is 400Actually, it would be 300 - 700 in your example
    Because when i tried to use:setImageableArea(200, 600,  400, 200);like the above code
    no changes occurs in the printed paperYes. You need to offset the Graphics object

  • How do i get the preloader to stay in the center of the screen.

    im trying to get my preloader to stay in the center of the screeen. So that when I change the screen resoultioon from 1920x1080 to 1360x768 to preloader stays centerd instead of off screen.

    Hi Sabermaster,
    Here are 3 example
    http://dealsdrizzle.com/preload_stage_center/type1.html
    http://dealsdrizzle.com/preload_stage_center/type2.html
    http://dealsdrizzle.com/preload_stage_center/type3.html
    Download link
    http://dealsdrizzle.com/preload_stage_center/preload_stage_center.zip
    Please note that in some cases i have set the stage to 100% and in some in px.
    Case 1 - In this I have set the position of loading image of the preloader in % and stage as 100%. You can see that the image is almost in center.. but not exactly.. resize the window and see the error magnify with higher screen resolutions.
    Case 2 - In here I have made a little modification to the type2_edgePreload.js file
    I have added these line in there somewhere. (inside type2_edgePreload.js file)
    pow = (window.innerWidth)/2;
    poh = (window.innerHeight)/2;
    preloaderImgHeight = 18; //Add your Image height here manually everytime once you are done finally with your entire composition else edge will change this file again when you save
    preloaderImgWidth = 62; //Add your Image Width here manually
    rect:[pow-(preloaderImgWidth/2),poh-(preloaderImgHeight/2),'62px','18px','auto','auto'],
    this keeps the preloader image centered to the page... resize the window to different sizes and compare.. It will be exactly in the middle.
    Case 3 - In advancement to Case 2 - I have added these statements in compositionReady event of stage.
    sym.$("Stage").css('margin','auto');
    sym.$("Stage").css('position','relative');
    sym.$("Stage").css('left','0');
    This centers the stage.. (For this case refer to type3_edgePreload.js; which is same as type2_edgePreload.js)
    Remember - if you open the compostion in edge the changes made to edgePreload.js will be reverted.
    If you happen to revert these files by any chance. Close Edge. Make changes to edgePreload.js file and open the .html file directly to see the result.
    I hope this helps.
    - Vinay

  • How do I force the player to open in the center of my screen every time, and not way on the side?

    How do I force the player to open in the center of my screen every time, and not way on the side?

    Solution is very simple, Just choose firefox as your default browser.
    Follow these steps :
    * Open '''Options'''
    * Click on '''Advanced'''
    * Now open '''General''' tab and click on '''Make FireFox The Default Browser'''. See Image below.

  • Can't get rid of Perian software update window in the center of my screen.

    When I woke up my computer this morning, there was a Perian software update window right in the center of my screen.  I cannot get rid of it and don't want to install it.  No matter what I push...it won't budge.  My choices are Skip this version, remind me later or install update...as I said I don't want to install it...how do I get rid of it ?

    Hi, and welcome to Apple Support Communities.
    Click on "Skip This Version."
    If that doesn't get rid of it, hold the power button down until the MacBook shuts down. Then start up again.

  • Can you explain me clearly how to make company code visible in cost center

    can you explain me clearly how to make company code visible in cost center master data using tcode kmlv

    Hi,
    There is no way to activate the company code field. If your Controlling Area and Company Code have one to one Assignment, then Company code is defaulted from the Controlling Area. However, if multiple Company Codes are assigned to one Controlling Area, then Company Code becomes a mandatory field in the Cost Center master data
    Also, in case you have multiple company codes assigned to one controlling area, please check the setting of the Controlling Area in Configuration and see if have selected "Cross Company Code Cost Accounting" . Also, check if you have assigned all the company codes to the controlling area
    Regards
    Mahendra

Maybe you are looking for

  • System Crashes After Bios Update

    Hi all,                  I got into a big problem after upgrading my system bios. I update all my drivers after windows install and with that i have also install the bios update after that when my laptop automatically restarts my laptop is not turnin

  • Oracle 11g compatibility with oracle 10g and 9i?

    Hi All I have some queries on 11g compatibility. Is oracle 11g client compatible with oracle 10g client which is already installed on desktop? If yes any changes to be done and where? Is oracle 11g compatible with oracle 10g/9i on the same server whe

  • AUC standard report

    Dear PS experts, is there any standard report on AUC numberwise ? pl help in giving the tcode for the same. all the capital investment projects, before making final asset/capitalisation, ps system generated automatic  AUC (Asset Under Construction) n

  • Error creating connection pool for WLS6.1 for DB2 connect

    Hi, We have installed licensed copy of Weblogic 6.1 Applciation server on HPUX 11.0. Our backend system is DB2 on Mainframe (S/390). We have installed DB2Connect JDBC driver ver 7.1 on HPUX. While creating pool throught weblogic console with followin

  • Problem installing Java Web Delevleoper Toolkit

    A while back I installed jwsdp-1.4 to a local directory on my workstation. Recently my workstation was upgraded from RedHat 9 to Fedora Core 1. I tried to reinstall jwsdp-1.4 to the directory it used to live in, but InstallShield insists that I'm try