How to make JFrame positioned to lower right corner of user's desktop

I'm a new java user, and I'm working on building a small
application. When the application is launched, I would
like the application (JFrame) window to be positioned
in the lower right corner of the user's desktop. Does
anyone know how to get the user's desktop size so
I can position the application.
Here is a code snippet where I lauch the app.
public static void main(String args[]) {
ArchiveRestore mainFrame = new ArchiveRestore();
mainFrame.setSize(500, 500);
mainFrame.setTitle("Master Model Automation");
mainFrame.setVisible(true);
Thanks
-cliff

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Will get the screen size. The Toolkit class is in the java.awt package.

Similar Messages

  • Amodal dialog box: positioning in lower right corner of screen

    I have what seems a quite common requirement, that is to automatically position an amodal dialog box (CL_ABAP_DIALOGBOX_CONTAINER) to the lower right corner of the screen.
    The logical approach to do this would be to read the screen resolution, deduct the size of the box, and pass the result to the TOP and LEFT parameters of the constructor of the container.
    Unfortunately, I haven't found any documentation of what the values for TOP and LEFT (and for WIDTH and HEIGHT, for that matter) really represent. They're not screen pixels, that's for sure.
    To read the screen resolution, I execute the following code:
    DATA:
      lo_consumer       TYPE REF TO cl_gui_props_consumer,
      ls_metric_factors TYPE cntl_metric_factors.
      lo_consumer = cl_gui_props_consumer=>create_consumer( ).
      ls_metric_factors = lo_consumer->get_metric_factors( ).
    In ls_metric_factors-screen-x and ls_metric_factors-screen-y I get back the screen resolution (x = 1280 and y = 994 on a 1280 x 1024 screen, weirdly, but close enough). Got this from another SDN post, BTW - thanks.
    When I manually position my dialog box to the farthest right lower corner, so that the mouse cursor can just about reach it, the GET_LEFT and GET_TOP methods for the dialog box return LEFT = 1453 and TOP = 387. So, obviously, these values have nothing to do with screen pixels.
    What I did, then, was to calculate a factor between the screen pixels and the TOP and LEFT values - a factor which is different for the X and the Y dimensions. I got:
    - (1453 / 1280) = 1.135 for the x dimension
    - (387 / 994) = 0.389 for the y dimension.
    With these factors, I calculate the initial position of the box as follows:
    l_box_pos_x = ( ls_metric_factors-screen-x * lc_factor_x ) - lc_box_width.
    l_box_pos_y = ( ls_metric_factors-screen-y * lc_factor_y ) - lc_box_height.
    This seems to work fine, at least on my system and my front-end PC, with all supported resolutions from 800 x 600 up to 1280 x 1024.
    It just leaves the question open: Does anybody know what the unit of measure for the sizing and positioning parameters of controls is? Why a box with a width and a height of 100 [whatevers] each is not square, but rectangular?
    And finally: does somebody have a more intelligent way to do this?
    Thanks, regards & stuff
    Rainer

    Hi Rainer,
    While creating the dialogbox container object, just set metric property to '1' (for Pixels) and then while setting TOP and LEFT you can provide pixels.
    For example,
        CREATE OBJECT REF_DIALOGBOX_CONTAINER
            EXPORTING
                WIDTH = 100
                HEIGHT = 100
                TOP = 638
                LEFT = 924
                CAPTION = 'hello world'
    <b>            metric = 1.</b>
    Then your calculation simply becomes,
    l_box_pos_x = ls_metric_factors-screen-x - lc_box_width.
    l_box_pos_y = ls_metric_factors-screen-y - lc_box_height.
    <b>NOTE: Now you will see that your dialog box is a SQUARE!!</b>
    Hope this helps..
    Sri

  • How to make tabs appear on top right corner in JTabbedPane

    Hi,
    the JTabbedPane class provides options to add the tabs on top, left, right and bottom. and on top, the tabs appear only on the left side.
    but i want the tabs to appear on the right top side..
    is it possible and if yes, how..
    any ideas!!!
    cheers and regards
    Deepak saini

    Hello Beat,
    thanks for your answer. But maybe I described it wrong. I have the logo still on my PDF-Document. I just want to have it on the top right corner and not, like it is now, on the left side of the paper. So the only question is how to move the logo to the top right corner?
    Kind regards
    Boris

  • How to create a popup notification in lower right corner of screen

    Hi
    I am fairly new to GUI building in Java. I am using Netbeans 5.0 and currently developing a desktop application. I wanted to display informational messages from the application to come up in lower right corner of screen - similar to when in MSN or Yahoo messenger if new person signs in. Similar pop-up is also found in Norton when it finishes live update.
    Currently I am using JOptionPane.showMessageDialog to do this, but it would be more appealing with messages showing on the side without interrupting the application user.
    Can someone point me to what I should look at to achieve this? Any sample code would be great help.
    Thanks

    Use JFrame from javax.swing package. JOptionPane is a built-in dialog that is located at the center of its parent component. With JFrame u can specify the position of your GUI. Try to read the Sun's java tutorial on Creating GUI with Swing: http://java.sun.com/docs/books/tutorial/uiswing/index.html

  • TS3999 In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ event

    In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ events?
    Better yet... as there's a lot of "wasted" space w/ too large Month title and empty space surrounding the Month title above and too much space surrounding the month/year slider bar below, how can I minimize these to allow me more usable / valuable calendar "contents" so I don't need to waste so much time clicking "more" just to see the bottom of the truncated third event and find out there are no 4+ events posted that date?  i.e. more "user-friendly" presentation?
    Thx!
    [email protected]

    In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ events?
    Better yet... as there's a lot of "wasted" space w/ too large Month title and empty space surrounding the Month title above and too much space surrounding the month/year slider bar below, how can I minimize these to allow me more usable / valuable calendar "contents" so I don't need to waste so much time clicking "more" just to see the bottom of the truncated third event and find out there are no 4+ events posted that date?  i.e. more "user-friendly" presentation?
    Thx!
    [email protected]

  • Camera already on from lockscreen on iPhone 5c. How do I turn it off? The camera icon is running in the lower right corner and when I swipe up from the bottom of the lockscreen it brings up the camera running.

    My camera is already running from the lockscreen, the camera icon is displayed in the lower right corner and when I swipe up the control center it brings up the camera first. If I swipe up again I get the control center.  How do I stop the camera from staying on and coming up first?

    I thought the feature was for it to be available for me to use, not to swipe up and have the camera already going. The control panel is not coming up first, it is the camera. In order to get to the control panel I have to swipe up again and the camera is still going. Annoyingly, I have had to disable the camera from the control panel so it isn't coming up first, and now it is unavailable to use quickly.  

  • HT5362 How to move the banners from the upper right corner to the low right corner of the screen on Mac (Mavericks)?

    How to move the banners from the upper right corner to the low right corner of the screen on Mac (Mavericks)?
    Sometimes, when I am about to click something in the upper right corner, the banners stand in the way. It is very annoying.
    However, I still need them and it is not an option to completely turn off notifications.
    Has anybody faced the same problem?

    Yeah, i've been playing around a bit with Notifications, and not being able to move there location is very annoying. The default location  normally means it is covering one or more tabs in Safari (or any tabbed application for that matter). Might have to try Growl again.

  • In the lower right corner of the window there is a column of little white boxes with "9.8" over it what is this and how do I get rid of it?

    In the lower right corner of the window there is a column of little white boxes. Right over the column is "9.8". What is this and how do I get rid of it?

    Please provide a screen shot of that issue.
    https://support.mozilla.com/en-US/kb/Adding+screenshots

  • I'm getting a very low signal from my Blackbird interface. The fire wire connection is selected properly and track recording sliders set. However the recording level slider in the lower right corner is grayed out. How can I get better signal?

    I'm getting a very low signal from my Blackbird interface. The fire wire connection is selected properly and track recording sliders set. However the recording level slider in the lower right corner is grayed out. How can I get better signal?

    If it's slow on startup it would be extensions loading or LaunchDaemons starting up. 
    You should have a look in:
    /Library/LaunchDaemons
    /Library/Extensions
    You can count out anything in your home folder and it shouldn't put anything in /System as that's reserved for Apple. 

  • How can I disable the Facebook Notification in Firefox 6 which takes my focal point from what I am typing until I close the notification in the lower right corner.

    When I have Facebook open, I get pop-ups in the lower right corner that tell me that I have new notifications or messages in Facebook. When the little pop-up shows, no matter what I am typing, my cursor is taken away until I click the x to close the pop-up. It is very annoying and slows me down so much. It disables my typing.
    If this cannot be resolved, I will either go back to version 5 or uninstall Firefox completely.

    Do a custom install and install each version in its own program folder to use multiple Firefox versions.
    * https://support.mozilla.com/kb/Custom+installation+of+Firefox+on+Windows
    * https://support.mozilla.com/kb/Installing+a+previous+version+of+Firefox
    Create a new profile exclusively for each Firefox version.<br />
    Create a desktop shortcut with -P "profile" appended to the target to launch each Firefox version with its own profile.
    See these mozillaZine KB articles for information:
    * http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    * http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    * http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox
    * http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile
    * http://kb.mozillazine.org/Testing_pre-release_versions
    <br />
    ''(in reply of a PM)''

  • Contacts lower right corner has 2 more entries

    On the iPad, some of my contacts have a person symbol and the number 2 in the lower right corner.
    When I tap on it, there are 2 linked cards, unified and unknown.
    Some of the info there is the same as the contact card, some is older info, some info has a different category such as work or home than the contact has now.
    Where does this come from?
    Does this info exist on the Mac too if contacts are synced? I don't remember seeing it there. On the iPhone?
    Why do only some cards have this?
    How can I make it into only 1 set of information? ( I assume it is taking up space with 3 sets of info.)
    If I do, will it carry over to the iPhone as well, or would I have to fix it there if the info is local?
    Still on iOS 5.1.1

    I also noticed unified and unknown on the iPhone. How can I make these merge with the contact that is already there so there is only one entry?

  • Document "tiles" into lower right corner when opened

    If this is a duplicate post, I apologize . . .I've not read all the posts in the forum, but I'm in a time crunch. 
    My document looks as though it will open normally, page comes up normally, and then it "tiles" down so that upper left corner of the page is in the lower right corner.  You can literally watch the page step down from a full page until only about a 1" x 2.5" section is visible.  It only prints that lower right corner, and that's all that is viewable.  Also, even though the document is multiple pages, it only shows what appears to be the last page, and says the document is "1 of 1 pages"  When it "tiles" down, it appears that there are multiple pages behind the page shown, but we cannot get to them.  I've tried opening it in Adobe 9.3 and Adobe 7.  I'm not a whiz at Adobe, but this is the first time I've seen this.  Any ideas??  Thanks in advance.

    I also noticed unified and unknown on the iPhone. How can I make these merge with the contact that is already there so there is only one entry?

  • My calendar isn't working on my iPad. I can't add any event.  Someone said there is a "plus" button in the lower right corner and I have none.

    I have tried to add events on my calendar app (the one already on my iPad when I got it) and I can't figure out how to add event.  A friend said there should be a "plus" button on the lower right corner and I have none. 

    Was able to fix it.  Just enable iCloud via your settings on your ipad.  For some reason that allows Calendar to work properly.  Just another way Apple is trying to make you use ALL of their products, rather than just one...

  • Since installing Firefox 4 I can't see the encryption symbol (e.g. for online banking)on the lower right corner

    Some sites are providing encryption certificates , so like ebay, and of course all internet banking sites. Previous versions of Firefox had been shown a symbol in the lower right corner (lock) with more details about the certificate. Is it still availabble, and how?
    Thanks for help and
    best regards
    Georg

    In Firefox 4 you no longer have the Status bar that showed the padlock in previous Firefox versions.<br />
    You can click the [[Site Identity Button]] on the left end of the location bar to see the padlock.
    A click on the "More Information" button will show details about the connection.
    The background color of the "Site Identity Button" on the left end of the location bar will change color (blue or green) and show the domain in case of a secure https connection.
    * Hover the Site Identity Button then to see "Verified by xxxx"
    * Click the [[Site Identity Button]] on the left end of the location bar to see the padlock
    * Click the "More Information" button in that pop-up to see additional information about the connection.
    You can also look at this extension:
    * Padlock: https://addons.mozilla.org/firefox/addon/padlock-icon/

  • Premiere Elements "sign in Required" will not let me enter Adobe ID.  Just spins in lower right corner.  Says "Please connect to internet and retry."

    Premiere Elements "Sign in Required" will not let me enter Adobe ID.
    Message "Please connect to the Internet and retry" comes up after loading icon run in lower right corner.
    I have new S/N key, have tried reloading program, and have loaded trial on another PC and brought to this PC.

    Gobindlakhiani for information on how to resolve the connection error please see Sign in, activation, or connection errors | CC, CS6, CS5.5 - http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html.

Maybe you are looking for

  • My Apple TV won't connect with my itunes store, even though I am connected on my computer and have my home sharing on- what do I do?? :(

    We have recently moved and have a new television and internet system. My Apple TV screen goes to the option of 'computers' and 'settings'. I really want to watch Netflix and it no longer takes me to that screen. It says that it can't connect to the i

  • XML Output with nesting of group

    Hi, Not sure if this is even possible to resolve but I figured I might as well ask. I have a report which is built using a Reference Cursor which outputs to XML. The data is coming back exactly as expected so I am happy that the cursor is working. I

  • Title of previewr window in report

    hi all how can i change the title of previewer window in runtime. thanks in advance. shoja.

  • 10G CRS 설치 절차와 문제 해결(LINUX)

    제품 : ORACLE SERVER 작성날짜 : 2004-11-29 10G CRS 설치 절차와 문제 해결(LINUX) ===================================== PURPOSE 리눅스 환경에서 10g CRS 설치 절차 및 문제 해결 방법 소개 Explanation 1. 적용 범위 리눅스 환경에서의 설치 및 구성 2. 개관 이 문서는, Cluster Ready Services 10.1.0.1 를 설치하고 구성하는데 도움이 되

  • Discverer Report Selecting 85M records

    Hi, Oracle Discoverer - 4.1 I have a discoverer report, which will selecting aroung 85 Million Records. While Running this report in Desktop, it takes arounnd 3 hours and still not populating any data. The CPU usage in the client goes to 100% and des