Sizing window and image for screen resolution

Applet creates Frame that displays JPG or GIF image. Would like to size Frame, and zoom image, on basis of screen resolution, to avoid necessity to scroll image. How can applet or button or frame access screen resolution numbers? Thanks.

Hi,
Call this method. Pass the Frame as parameter
<pre>
public void centerFrame(Frame frame)
//Center the window
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
</pre>
Hope this solves ur problem
Regards,
Harsha
[email protected]

Similar Messages

  • Why are some jpg images scrambled when they appear in my screen saver?   The same images look fine in Preview and Finder.  Some images appear scrambled in the screen saver 'preview' window and the actual screen saver. Other jpg images look fine.

    Why are some jpg images scrambled when they appear in my screen saver?   The same images look fine in Preview and Finder.  Some images appear scrambled in the screen saver 'preview' window and the actual screen saver. Other jpg images look fine.

    The desktop image is fine, taken from the exact same pool of jpg photos.  However, as soon as the slide show screen saver comes on, the images are scrambled.  What is it about the apple screen saver algorithm that scrambles the pics?

  • Auto resizing tables for screen resolution

    Hi everyone.
    Im currently working on my website using dreamweaver, and i
    just stumbled across a problem. Im building my website for screen
    resolution 1020x768. However, alot of people tend to use 1280x1024
    nowadays. The problem is that images get all screwed up at
    different screen resolutions.
    The best way to fix this would be auto resizing tables (so a
    1280 using can view my 1024 website without any problems). But, i
    have no idea how to create this. Ive been trying dreamweavers help,
    but that didnt help me.
    So i was wondering if anyone around here has the solution for
    my problem.
    Thanks in advance!

    Hi everyone.
    Im currently working on my website using dreamweaver, and i
    just stumbled across a problem. Im building my website for screen
    resolution 1020x768. However, alot of people tend to use 1280x1024
    nowadays. The problem is that images get all screwed up at
    different screen resolutions.
    The best way to fix this would be auto resizing tables (so a
    1280 using can view my 1024 website without any problems). But, i
    have no idea how to create this. Ive been trying dreamweavers help,
    but that didnt help me.
    So i was wondering if anyone around here has the solution for
    my problem.
    Thanks in advance!

  • Just updated my iPad 2 to ios7 and now my screen resolution is terrible...

    I tried rebooting several times, but it didn't help. Everything else seems to be working fine. Any suggestions?

    Diavonex 
    This helped meRe: Just updated my iPad 2 to ios7 and now my screen resolution is terrible...     Jan 4, 2014 10:50 PM    (in response to Batsy2000) 
    Try restore iPad
    http://support.apple.com/kb/ht1414
    Backup before you do it.
    Just tried this...did not work. Resolution is still horrible. This is not an issue of it just not looking smooth or sharp.  It's so much worse than that.  It was actually fine right after the update.  The next morning when I turned it on it was messed up.

  • Having trouble with pop-up windows and ads for MacKeeper

    I've been having trouble with pop-up windows and ads for MacKeeper and similar "services." Tried to download "MPlayerX" a week ago and it all started then. I thought I deleted the file but I'm still having trouble. I've been digging for solutions on here, but nothing I've found on here has worked yet--the VSearch stuff (I think) isn't on my hard drive. Any advice?

    You installed a variant of the "VSearch" trojan. Remove it as follows.
    This malware has many variants. Anyone else finding this comment should not expect it to be applicable.
    Back up all data before proceeding.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.venus.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.venus.daemon.plist
    /Library/LaunchDaemons/com.venus.helper.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/venus
    /System/Library/Frameworks/v.framework
    The problem may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Is there any diffence in rendering websites with safari for windows and safari for mac os, or are both equal?

    Is there any diffence in rendering websites with safari for windows and safari for mac os, or are both equal?
    So is it necessary to buy a mac to guarantee that a website acts like it should, or is the Safari for Windows enough?

    So is it necessary to buy a mac to guarantee that a website acts like it should, or is the Safari for Windows enough?
    Pages render the same for Mac and Windows in Safari.

  • Windows XP Pro Desktop - Screen Resolution and Color Quality - After Palm 6.2 Installation for Palm TX

    Recently upgraded my Palm software to 6.2. for my TX.  Now when I sync to Outlook, my windows desktop reverts to lower quality screen resolution (640 x 480 pixels) and lower color quality (8 bit).
    I then make the necessary display changes for my windows desktop back to higher quality screen resolution (1280 x 800 pixels) and highest color quality (32 bit).  Everything is fine until I sync again or shut down the computer and restart, causing the windows desktop to revert back to the lower quality screen.
    Any thoughts on possible solutions to this annoying problem.
    Thank you
    Post relates to: Palm TX

    Hello!
    First thing to do is to update the display driver for your computer.  Also make sure to use 96 DPI for the DPI setting, using another setting can cause this issue too.
    Post relates to: Treo 650 (Unlocked GSM)
    Message Edited by thetreoguy on 03-17-2009 10:29 AM

  • Synchronizing sound and image for splash screen.

    Hello all,
    I have a peculiar request. ...
    I have a sound file (about 137KB) and an animated gif (about 134KB).
    I would like to use this as my splash window before my app starts up.
    I know how to load these 2 to a screen but my problem is how do I synchronize the sound to go along with the image when it starts up? (Its a gunshot sound, whcih is looped with the animated image showing the bullet holes ;-)
    I've been investigating using the Timer class but no success to date.
    Currently, the sound file loads up, starts and then a few seconds later the image..
    So.... How do I:
    1. Load the sound first.
    2. Load the image.
    3. Start both of them synchronized.

    This is actually pretty involved...
    Are you using java.applet.AudioClip to play the sound? Are you loading the animated gif as a JLabel or something using ImageIcon?
    If you are using AudioClip for the audio, I suggest that you cache the sound and image before playing the sound... otherwise you'll probably hear pops or the sound will pause. To cache the sound, do this:
    AudioClip clip = Applet.newAudioClip("somefile");
    Unfortunately, java really sucks at handling animated gifs. On slower computers, I've seen it take about 15-20 seconds to load an animated gif that's around 90k in size... totally unacceptable! If you have a gif that just plays a once (or a few times) and then stops, you'll have to flush the graphic to restart the image. This will reload the file and cause the long delay every time you need to replay the gif.
    It seems like the best thing to do is to break up the animated gif into frames (either put each frame in its own file, or place each frame into one large image file and use clip rectangles to retrieve frames) and handle the animation yourself with your own thread. Alternatively, you can use the GifDecoder utility available at http://www.fmsware.com/stuff/gif.html, but be careful when using GifDecoder, it eats up a lot of memory for larger Gif files. When you handle the animation yourself, things should work properly. Again, make sure to cache the images by doing something like:
    ImageIcon ii = new ImageIcon("somefile");
    Once everything is preloaded, things should be pretty much synchronized if you play the sound and then show the image.
    To have more control, you may have to use an object with synchronized methods... like if you want a sound to play on the 3rd and 10th frame of animation. Another option is to use Quicktime for Java.
    If you need more info, let me know!

  • Windows XP Pro Desktop - Screen Resolution and Color Quality

    When synchronizing my Zire after many successful and no problems the XP Pro screen resolution reverted to the lowest profile.
    I can reset the resolution to the True color 1024 x 768 but after a minute or two it reverts again.
    1. Reinstalled driver for Intel video on Compaq D510C motherboard and get same problems as well as corrupted looking graphics on screen.
    2. Switched to a known good monitor and same problems (which I did not think was the problem but did to verify).
    3. Installed new gForce5200fx graphics card and video still reverts and is corrupted looking even when in higher reset resolution.
    4. Created new user to see if user profile was corrupted and still reverts and is corrupted looking even when in higher reset resolution.
    Any suggestions?????

    I also flashed the bios

  • SAP GUI 7.20 for Windows and problem with Screen Painter

    Hello,
    I just installed the SAP GUI 7.20 for Windows and it looks good.
    But when when I start the Screen Painter for a dynpro I get the following message:
    Graphical Layout Editor not available. Continue with alphanumeric editor.
    And: EU_SCRP_WN32 Connection broken  '..' / CPIC
    The SCreen Painter is installed correctly (I can start ist manually from file system) and the RFC destination works.
    Any idea?
    Regards,
    Ole.

    Hello,
    I've uninstalled all SAP installations, cleaned the registry of Windows XP and deleted all folders with SAP content. Then I've installed the SAP Gui 7.20 again and it works.
    And now I will update the Screen Painter with the information from the OSS-Note!
    Thank's for your help!
    Regards,
    Ole.

  • Images: Different screen resolutions, howto ...?

    As you might know, there are several screen resolutions, used by different devices (iPhone 3G/3GS/4, iPad).  You might take a look at: http://stackoverflow.com/questions/2993006/designing-for-varying-mobile-device-resolutions -i-e-iphone-4-iphone-3g  An example: If i would like to build a generic app, with optimized images for the iPhone 3G/3GS, 4 and iPad, how can i implement the images within my application with the use of different screen resolutions (dpi). 3G: image_low_res.jpg, 4: image_high_res.jpg etc.  Is there a better overview for iOS devices showing the exact resolution (dpi)?

    In objectiveC/XCode, you would have two images - one at standard size, and one at double resolution for the retina display. The double-resultion image has a '@2x' suffix just before extension. The OS automaticallt uses the correct image depending on the type of phone (i.e. it uses the @2x image on the iPhone4, and the original image everywhere else).
    Of course this doesn't help us in Flash.  I don't think Adobe have built this feature in to the packager?
    Perhaps a good way to achieve the same results is to have the application detect the phone type on startup/constructor by checking the screen size (Capabilities.screenResolutionX/Y).  Then, whenever you need a screen coordinate, distance or an image, you have a custom class (probably static methods) that you ask for this information.
    It seems like a lot of work, but if you are really keen on supporting the retina display, this is probably your best bet!
    Psuedo code:
    // Two images in the library
    // spriteA.png
    // [email protected]
    // All my coordinates are measured in original iPhone coords (320x480)
    // I am now asking for a point in the middle of the screen
    // If I am on iPhone4, the resulting point will be (320,480)
    // If I am on iPhone, the resulting point will be (160,240)
    var p : Point = ResHandler.createPoint( 160, 240 );
    // Now I grab my bitmap
    // If I am on iPhone, the resulting bitmap will be spriteA.png
    // If I am on iPhone4, the resulting bitmap will be [email protected]
    var b : Bitmap = ResHandler.createBitmap( 'spriteA' );
    // Now place the bitmap
    b.x = p.x;
    b.y = p.y;
    addChild( b );
    // Now move the bitmap by 100 pixels.
    // If I am on iPhone the resulting distance will be 100 pixels
    // If I am on iPhone4, the resulting distance will be 200 pixels
    var d : Number = ResHandler.getDistance( 100 );
    b.x += d;
    Hope it helps

  • Best way to create a background image for all resolutions without drastically increasing file size.

    I see a lot of great background images with complex designs that resize with different screen resolutions. I can create the designs, but I don't know how to create a complex image for large screen resolutions without making it a large file, or it loosing quality with it stretches to the larger size. Is there a code that resizes images when stretched, or do I just have to live with a slower load speed with complex background images?

    The background doesn't resize, it shrinks:
    http://johnpatrickgiven.com/jquery/background-resize/
    Basically make a 1920x1080 or higher resolution file and use that script.  There will always be a maximum but based on your response that is not your monitor.  Photoshop and other tools do a pretty good job compressing jpeg files and most internet connections are fast enough to make it seamless.

  • Windows Does Not Remember Screen Resolution after restart

    Hi Everyone,
    I have a strange problem with Windows 8.1 Pro
    My screen resolution resets to 800 x 600 everytime i restart my PC, and I will have to set my resolution again everytime I start my PC.
    Any idea?
    Cheers
    Nelson

    Hi Nelson,
    Please check the display adapters on Device Manager.
    It may be caused by your graphics driver.
    I suggest you reinstall the latest graphics driver to check the result.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • How to Get Windows 10 Image for Galileo

    I purchased a Galileo gen 2 board and would like to start prototyping a project I have in mind -- but I cannot for the life of me figure out how/where to get a Win10 image for the board.  I've signed up (twice) through the 'Connect' web site (and gotten
    zero replies), and the links on the Connect site that talk about getting an image if you bought your board yourself just lead to a 404 error.
    Any suggestions?

    Figured this out.
    sign up/join
    MICROSOFT WINDOWS FOR WINDOWS DEVELOPER PROGRAM FOR IOT EULA
    Under
    Windows Embedded Pre-Release Programs Home / Programs Windows Developer Program for IoT
    once you've joined and click on link below, you will see the downloadable link to get 170mb  9600.16384.x86fre.winblue_rtm_iotbuild.150309-0310_galileo_v2.wim  - this file under EULA cannot be shared.
    Hope this helps someone else.
    Go create something using IoT!

  • Photoshop cs6 window too big for screen, lost the drag facility?

    I have lost the corner of the photoshop window below the dock so don't have access to the drag facility in the window corner. I have tried resizing the screen but this hasn't helped, any ideas welcome!!

    What OS are you running?  I would think it would have some function to allow you move windows that are larger then your display so you can move the windows so part of the window frame is on screen so you can then re-size the window.
    For example I just move my Chrome browser window sot the top of the window is behind the task bar.  I now can not move it necause I can mot position the mouse int the window header bar.  However I can position the mouse over the running Chrome icon in the task bar. Windows will show a preview of the running Chrome window or windows. If I right click on a preview window Window's will open a right click menu  I can click on the move item and them move the off screen window on to the display using the arrow keys or the mouse.

Maybe you are looking for