Fixed Size WIndow

How do I create a window (frame) that has the same physical dimensions regardless of screen resolution? Say, for example, 15 cm x 10 cm? I thought I could use the following to compute the pixel dimensions:
Toolkit kit = Toolkit.getDefaultToolkit();
int resolution = kit.getScreenResolution();
System.out.println("Screen resolution: " + resolution + " DPI");However, getScreenResolution always returns 96 in J2SE 1.4, regardless of my screen resolution (I tried 800x600, 1152x864 & 1280x1024). So I guess I'm missing something. Or is this not possible in Java?

public abstract Dimension getScreenSize()
                                 throws HeadlessExceptionGets the size of the screen. On systems with multiple displays, the primary display is used. Multi-screen aware display dimensions are available from GraphicsConfiguration and GraphicsDevice.
Returns:
the size of this toolkit's screen, in pixels.
From API documentation.

Similar Messages

  • Opening a new fixed-size window from a link

    I'm primarily an illustrator, but am working on my own new
    web site and do a few for other folks as well.
    I'm by no means a guru so excuse my clueless questions... (I
    use Dreamweaver 8)
    I see many web pages that can do
    any or all of the following and I'm hoping without complex
    coding or js stuff...
    + Open a fixed-size window from a link on a page - as in a
    smaller window like 250x400 that would contain a photo or drawing
    + Opens a new page from a link with a fade-in (ie, from blank
    or dark background to an image) like what happens when you click
    the "view larger" link at this page =
    http://www.imagekind.com/showartwork.aspx?imid=e08f2a00-8925-4353-8c72-e0d1f4eb1879

    > I was going to post a screen capture but looks like that
    isn't
    > possible in this forum.
    There's a reason. Screen captures only demonstrate "what",
    without
    providing any useful "why" information. Show us your code,
    please - best
    way would be to post a link to the page. I suspect the reason
    you are
    seeing what you are seeing is that the container for the
    lightbox effect is
    not large enough, or the image being used as a background for
    that container
    is not large enough. We'll only know that by seeing the live
    page.
    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
    ==================
    "Nate Owens" <[email protected]> wrote in
    message
    news:gqg0ch$2i4$[email protected]..
    > This is working well (Lightbox) but it does something
    that I haven't
    > figured
    > out how to fix.
    > It opens my image against the dark background as it
    should with the parent
    > page ghosted in back, but there is a margin at right
    side and bottom where
    > the
    > dark area abruptly ends and the parent page is visible
    in those areas
    > without
    > the dark image background extending to fill the window.
    > I've examined the html but see nothing I recognize that
    denotes the
    > extents of
    > the dark area. I was going to post a screen capture but
    looks like that
    > isn't
    > possible in this forum.
    > Any ideas would help.
    > Thanks,
    > Nate
    >

  • How to set a fixed size window, so that moving 2D pictures wouldnt go off?

    Hi
    I dont if this question has been asked or no & also not sure if its right to be posted here as my problem is a java 2D graphics problem in swing environment.
    I want to know is how can i set the window to a fixed size with boundaries such that my graphics 2D picture in the swing window will not go off the edges of window when i do some transformations with the 2D picture.
    For e.g:
    so far ive got a frame window of size 350 by 350 with my 2D picture inside it made up of shapes etc...
    when i apply some transformation to it (moving it) for a distance it goes disappeared off window beyond 350 and will come back if i move it back.
    So how do i restrict the window so that when picture reaches the edge, it will not be able to move any further?
    Do i set some specific bounds to the JFrame?
    i hope i've explained it properly
    Thanks

    In a 2D coordinate system the horizontal values are represented by some letter, usually x. In the same coordinate system the vertical values are classically represented by y.
    Note: In your code, if you wish, you can replace x and y with anything you desire--p and q or perhaps jeff and alice or any variable name you wish, but for simplicity, and usually ease of understanding because almost everyone has had 100's of math problems drilled into their head with (x, y), x and y are used as convention.
    In Java the screen coordinates run from 0 to the width-1 for x and 0 to height-1 for y of the component you are using to display.
    So logically when you have a value of x or y that goes beyond the addressable bounds of your display, then you have to make some type of adjustment--when your value dips below 0, you reset it to 0, when your value goes above what ever width-1 or height-1 then you have to set that value to width-1 or height-1.
    This all assumes that when you hit the wall, floor, or ceiling you stick there until you change directions--if you wish to wrap then you set your value to the opposite bound--so if you go below 0, you would then pop out back in on the right side--your appropriate x would be set to width-1 instead of 0 and in the case of y going below 0 your y would be set to height-1. This is also to say that when you descend below your minimum, then you would pop back out on the opposite side you went out on--so x greater then width-1 would get set to 0 and y greater than height-1 would get set to 0.
    That is not even a start on if you want to include elastic collisions, angle of impact, any type of deceleration force, or anything else.
    In any case... I would recommend that you add more math to your studies, I've never met an engineer or computer science grad that said: "Wow, I really regret taking all that math in college (or HS), I never use it."

  • How to set the fix size jframe window

    when I run the jframe ,the jframe window size is very small
    1)how to set the fix size jframe window??
    2)how to set the jframe cannot change the window size??
    thx~~

    1. You can set the size by calling JFrame's method setSize. There are two versions of this method: (1) setSize(int width, int height) and (2) setSize(Dimension d). Note, that when you use this method to set the frame size, you don't have to call JFrame's pack method.
    2. JFrame has a method called setResizable(boolean resizable) which you can call with the argument false.
    Without any ill intent, these questions are regarding something that is very easily answered by looking at the documentation for the JFrame class. I suggest to anyone working with swing to at least look briefly through the base classes they're extending before giving up. In my experience it is always more gratifying to figure things out on my own than asking someone. But please don't take this the wrong way, I respect people who seek out help in order to further their knowledge, instead of just giving up.

  • Fixed finder window size

    I was wondering if there is a setting for opening a finder window?
    it would be great to have fixed size and location if I open a new finder window ...
    would be an improvement of my workflow and avoid to resize each new finder-window to my preference manually ; )
    does anybody know how to set this in either a preference file or with the terminal?
    BIG thanks in advance for any input!

    I just did a search at macupdate.com for the term "finder window".  Mixed in with a bunch of mis-hits there's some that potentially might do what you want (e.g., Finder Window Manager, Windown, Intelligent Windows).  I personally have no knowledge of any of those of if they do exactly what you want.  I'm just basing this on what I see in the one line descriptions in the search results.
    As for any settings in the finder itself, no, there isn't any.  The finder always "thinks" it knows what you want and what's best for you (yes, I'm being sarcastic if it isn't obvious)!

  • How do I set a fixed size for a window (frame) :P

    hello!
    Was wondering if I can set fix dimensions (size) for a window(frame) in Java.
    Background: I have a menu and when I click on one of the options a window opens but I hate the fact that I can enlarge it...wish it would be fixed sized and have scroll instead... :P
    any ideas?
    many thanks!
    Cristina

    sorry for not using the swing forum but i considered java programming forum as more or less enclosing all problems Do you understand how to use forums? First you should be searching the forums to see if you questions has been asked and answered before. (Very few questions posted in the forums are original). It makes sense to search the forum where the questions should have been posted in the first place.
    For example, if you had searched the Swing forum using "fixed size jframe" you would have found this posting at the top of the search results:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=712407
    So you would have had your question answered in less than a minute and we wouldn't have wasted time answering a question that has already been answered.
    A win-win situtation for everybody.

  • Fixed size browser window pop-up from flash?

    Hi there... I'm finishing off a flash website for a band and
    I've created a little music player that's 380 x 250 pixels...
    There's a "launch music player" button in my site and when pple
    click on it, I'd like the music player (which is a flash file
    embedded in an html file) to pop up in it's own little browser
    window. I know how to make normal full size windows pop up (by
    using the: getURL("location", "_blank").... function) but I need a
    browser window that doesn't scroll and isn't resizeable, with a
    fixed size of 380 x 250 to pop up. I know how to do this in HTML
    (dreamweaver), but not in flash - can anyone help?
    Mal

    Using the getURL function you can call a specific javascript
    function where you can create a new window with specific size:
    getURL('javascript:FUNCTION();');
    Cheers,
    Gorka

  • Setting fixed size screen resolution in Arch VirtualBox guests...

    Hello everyone.,
    I've installed an Arch Linux 64-bit guest os in Windows 7 64-bit host. And i've also installed guest additions succesfully.
    Now I need to restrict X to 720x1280 (720p) screen size for screen capturing.
    I've already tried few methods for resizing it:
    1) Tried disabling AutoResize in VirtualBox.
    2) Tried to hint the display size in global settings (VirtualBox => File => Preferences => Display), but when I enter X it fits automatically the whole window again.
    3) Tried to write a configuration file in "/etc/X11/xorg.conf.d/90-monitor.conf" (as explained in Xorg wiki page), but it still doesn't work. I couldn't find my monitor Identifier name, tried several ("VBox0", "Screen0", etc...)
    4) Tried to generate single Xorg conf file ("sudo Xorg -configure"), but it terminates with error: "Missing output drivers. Configuration Failed".
    And also i've googled anything related to fixed size screen WITH guest additions (which I still need for shared folders), seems nobody actually asked for it.
    Any help will be appriciated, thanks.,

    What is native resolution? 1080?
    Do you need a window with guest os smaller than host video?
    Did you try to set resolution on X guest and enabling autoscaled feature in VirtualBox?

  • Fixed size ratio

    I’m using the Open Browser Window behavior on a link to
    open a new window with a fixed size ratio. This works fine but I
    would like there to be a link in that window that will open other
    pages within it. I can’t figure it out because the Open
    Browser Window behavior has no setting for opening another page
    within the current window. There has got to be a way to do this!
    Pleas help me out.

    I don't understand. You open a popup window and then want
    that popup to have links that open other popup windows? Exactly why
    can't you do this?

  • Redirect in fixed size

    I have a link that when clicked has a new window popup with a
    redirection attached to it. This is a fixed size with no scroll.
    But when the redirection happens the browser is still the fixed
    size and you cannot see all of the new page.
    what javascript to I need so when the redirection happens, it
    occurs as a full page?

    ottz0 wrote:
    > I have a link that when clicked has a new window popup
    with a redirection
    > attached to it. This is a fixed size with no scroll. But
    when the redirection
    > happens the browser is still the fixed size and you
    cannot see all of the new
    > page.
    >
    > what javascript to I need so when the redirection
    happens, it occurs as a full
    > page?
    >
    I think Massimo has an extension capable of doing what you
    want - I'm
    not 100% sure - but you could try it - it's called Windows
    Suite 1.1 -
    you'll find it under 'JavaScript' here........
    http://www.massimocorner.com/
    HTH
    chin chin
    Sinclair

  • Fixed Size Table

    I'm creating an rtf template for a master detail report which will be printed over template papers not white papers, so i want to make a fixed size table lets say of 10 rows for details. When i tried to make a table of 10 rows and put the for each loop statement in first row i got table of details + 9 empty rows !! so please can anyone guide me here.
    Thanks in advance.

    Does it really make sense to specify a limit in terms of storage space rather than time? If there is a 500x difference in the number of inserts over the course of an hour, it seems likely to me that users would generally want to keep a certain number of days worth of log information rather than keeping a certain volume in MB. If you ask for a limit in MB, users that use the low rate of inserts would end up with a table so small that if you got to the point of generating lots of records you'd be aging them out far too fast-- those that use the higher rate of inserts would end up with a huge table that has far more history than they need just to accomodate keeping a certain window of log records at the peak.
    If you are determined to limit the size of the table, you could potentially run a program periodically that determines the size of each partition (via DBA_SEGMENTS) and then drops the oldest partition if the overall size is too large. But a single partition is likely not to have a huge level of granularity-- you're probably not going to partition by much more than the day, so dropping the oldest partition would purge all the logs for that day. You could potentially get more control over space by not partitioning the table and just deleting the last N rows if you are over the limit, but that probably involves much more frequent checks of space usage and is far, far less efficient in doing the actual deletes.
    Justin

  • How to resize a jpg/gif file to a fix size using jimi ?

    I have search from the web and didn't find any example on doing this.
    Can any one give example on how to resize a jpg image. let say 120x240
    to a fixed size 40x40 ?
    thank you

    Hi.
    When you got that image in form of a file, just load it and invoke the image's getScaledInstance(...)-method.
    Here's how it could work:
    import java.awt.*;
    public class Test {
    public static void main(String[] argv) {
      // define where the image comes from:
      URL toImage = new URL("file:/C:/test.jpg");  // or the like
      // get the image:
      Image image = Toolkit.getDefaultToolkit().createImage(toImage);
      // scale the image to target size (40x40 here):
      Image smallImage = image.getScaledInstance(40, 40, Image.SCALE_DEFAULT);
      // you might want to do other things like displaying it afterwards
    }HTH & cheers,
    kelysar

  • I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.   I have been searching every other day for over a month trying to find a fix in Windows Safari with n

    I like and use Top Sites but it has become unsuable with this constant blacking out and reloading the thumbnails.  My MBP has not seen a problem at all.
    I have been searching every other day for over a month trying to find a fix in Windows Safari with no joy.  I want to resolve, not switch browsers. Please offer up a solution that only refreshes the Top Site thumbnails once a day or as some controlable interval.  Started about two versions ago, now on ver 5.1.5. Windows 7 64bit.
    Safari 5.1.5 for Win64 bit, Windows 7!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I think I solved the wifi connection problem, just by switching off completely the router! sounds trivial, but in this case it worked!!!
    the funny behaviour of the trackpad/cursor still persists. any suggestion???
    thanks again

  • Fixed size regions in Apex 4.0

    It is possible to create a fixed size regiion - that is only using half of the screen height to have a report (and having a bar to on the right to move up/down) ?
    I'm going to use it for a 2+ master-detail report.
    regards
    Mette

    Hi Mette,
    what region template and which theme are you exactly using? For most region templates you can pass in additional style attributes with the "Region Attributes" property in the "Attributes" section of a region definition.
    So for example you could use
    style=\"height:500px;overflow-y:scroll\"(remove the \ out of the code example)
    Regards
    Patrick

  • Hyper-V 2012 R2 - Fixed Size VHDX Have VMs Paused Due to Disk Space Shortage

    I am running Hyper-V Server 2012 R2 (Server Core).  I have an SSD boot drive and a 10 Tb Storage Space HDD (Double Pairty - RAID6) where all VMs are stored.
    I have one VM setup with an expanding VHDX file.  It is setup with thin provisioning for 2 Tb and about 1.5 Tb is currently used.  The VM paused due to physical disk space (SS drive) being low.  I turned off this VM and tried to start a different
    VM that has two fixed size VHDX files (also on the SS drive).  This second VM would not start either.  I got the same error message, as occurred on the first VM, about the physical disk space being low.  There was about 10-20 Mb of physical
    space left of my SS HDD when these errors occurred.
    Given the first VM is setup with an expanding VHDX that makes sense to me that at some point there may not be enough physical disk space for the VM to expand and continue to run.
    But given my second VM is using a fixed VHDX it doesn't make sense to me that I cannot get this VM to start.  Even if the Storage Space disk were completely full I would expect this VM to be able to start?
    Thanks for any assistance you can provide.
    Theokrat

    Hi Theokrat,
    "The HDD was setup with approximately 5 Tb storage pool as double parity."
    "My first VM has a 4 Tb fixed VHDX. Thus there was only about
    1 Tb free space left for the second VM."
    "And for the VMs I'm asking about I set up those options to point to my HDD which is the D drive."
    So, there are two VMs (the first VM has 4TB disk , the
    second VM has 1TB disk )and all of the VMs'  files
    are stored on the 5TB HDD (the 1TB VHDx is dynamical) .
    You turned off the second VM when it was paused due to lacking of disk space (before this the first VM is off ).
    When you start the first VM , it still can not start and the error arose again ,right ?
    If there is no any other factor led to disk usage increasing , I think the issue might be the startup memory of first VM is larger than or equal to the second VM's .
    Please try to check that , if it is true , you can try to set lower memory for the first VM then start it again .
    Best Regards
    Elton JI
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • How can I copy a custom workspace to new installation? CS5 PC

    How can I copy a custom workspace to new installation? CS5 PC Must be a prefs file somewhere?

  • Navigation column left blank in Chrome/Firefox

    We're in the process of migrating our exisiting help content over to RoboHelp. I've generated WebHelp content using Robohelp 9.0.1.262 and moved it to a server. Unfortunately when I open the content in a web browswer, the left-most navigation panel w

  • Getting an error for myField.setEchoCharacter("*");

    Hi ppl, I guess the book I'm using is bit out of date but can someone plz explain why am I getting a string error when trying to set the echo char of a field using the setEchoCharacter() method? myField.setEchoCharacter("*"); Thnx, McMurphy

  • LV file corrupt? I try to load, it asks to find the file I just tried to load

    I have a LV file that when I go to open it, it brings up the prompt saying "please find the Vi named "xxxx.vi" " which is the file that I just tried to open.  I select the file again and just stays in a loop and never actually opens the file.  Both I

  • Need help for begginer :)

    Hello, my name is Angelo Vargas and i'm new at Java. I do know about computer programming, but don't know java that well. I have a question . Is it possible to place objects (Buttons, Labels, text fields) onto the window but instead of panes, can it