Fixing size of frame and player

hi! have problem defining a fixed size for my gui and the player that plays inside it can anyone help? thx

Whether for java.awt.Frame or javax.swing.JFrame, use the setPreferredSized() method... Check the API on usage...
Here is an example...
theFrame.setPreferredSize(new Dimension(300,75));as you can see from the APIs, setPreferredSize takes a Dimension object... You will have to play around with the numbers to get your desired results...
- MaxxDmg...
- ' He who never sleeps... '

Similar Messages

  • 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.

  • I need to save some pictures from iPhoto to a SDHC photo card for a digital frame and was wondering if there is a way to shrink or compress file size for each picture as I have already cropped the pictures? Thank you

    I need to save some pictures from iPhoto to a SDHC photo card for a digital frame and was wondering if there is a way to shrink or compress file size for each picture as I have already cropped the pictures? Thank you

    Yes, you do this when you export the images from the Library.
    File -> Export
    in the Size section, you don't need images larger than the frame size, so you can specify that and in the Jpeg Quality you can select the amount of compression used.
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.

  • Cut and Paste: Frame and Content Size Auto Changes

    I'm working in InDesign CS2 and am having this reoccurring problem.
    When I cut and paste frames with placed images (or pull images from a library) the frame and image will both expand to between 300%-3,000%. As you can imagine, it's very frustrating to have to create new frames and place new images every time. Any suggestions on how to fix or work around?

    I'm still having problems with this, even using Paste and Match Style.
    My table has three rows with gray background, then three rows of white; this pattern repeats for many rows. In the center row of each three rows is some text, while all other rows are blank. I want to move all this text down three rows, so that the text that was in the center row of the gray rows now is in the center row of the white rows, but I want the row colors to remain unchanged. Here's what I've tried.
    If I "Cut" the selected cells, then the background colors are cut, so this is no good. Instead, I Copy the cells, then hit the Delete key. This leaves the background alone. Now I select a cell three rows down from the top. If I Paste, then the old backgrounds are pasted in, which is not the behavior I want. If I Paste and Match Style, then all the backgrounds are overwritten with white, except those single rows that originally contained both text, and had a gray background. The original cells that were gray but had no text are pasted in as white.
    This latter behavior makes no sense to me. There seems to be a difference in how Paste and Match Style works, depending on whether the copied cells had text, or were blank.
    Is there another way to do this rather common task—moving text around a table that has alternating-colored rows, without messing up those colors?

  • T3i sensor size vs. full frame and how does that effect lens measurements?

    I am new to both photography and the T3i camera. I have been reading Jeff Revell's book "Canon EOS Rebel T3i / 600D: From Snapshots to Great Shots". In chapter two he talks about "Lenses and Focal Lengths". In discussing wide-angle lenses he says
    "As for which lenses would be considered wide angle, anything 35mm or smaller could be considered as wide."
    Latter he discusses normal lenses and says
    "The normal lens for full-frame and 35mm cameras is the 50mm lens, but for the T3i it is more in the neighborhood of a 35mm lens."
    I understand that there is a 1 / 1.6 ratio between the T3i and a Full Frame camera. In the first quote does the 35mm refer to the T3i measurement or a full frame measurement?
    Is there a standard nomenclature to indicate if you are specifying a "full frame" value verses the T3i value? If so, what is it?
    When I look at one of my lenses, say the 18-55mm lens, is this the T3i measurement or the standard full frame?
    Thanks in advance for your assistance.
    --Jesse
    P.S.  I could not find a publisher’s forum for this book or I would have asked the question there.

    Jesse-T3i wrote:
    "As for which lenses would be considered wide angle, anything 35mm or smaller could be considered as wide."
    In the first quote does the 35mm refer to the T3i measurement or a full frame measurement?
    Is there a standard nomenclature to indicate if you are specifying a "full frame" value verses the T3i value? If so, what is it?
    When I look at one of my lenses, say the 18-55mm lens, is this the T3i measurement or the standard full frame?
    The fast answers are:
    When he mentions the 35mm as the basis for determining what's "wide" he is referring to the APS-C crop-frame size sensor.
    There is no nomenclature to indicate if you are "full frame" vs. "crop frame" on a lens because all lenses are reported in true focal lengths.  There is a nomenclature to indicate if the lens was designed to only project an image circle onto the sensor which is large enough for "crop frame" ... which is what the "EF-S" lens is.  If the lens is for "full frame" (which also works on all crop-frame) then it will have the designation "EF" for most lenses, but Canon also has a few specialty lenses such as the "TS-E" (tilt shift) and "MP-E" (macro photo) lenses which also provide full-frame sensor coverage.  Incidentally... this is just Canon's way of tagging a lens... Nikon uses the terms "FX" and "DX" (for full frame and crop frame respectively).  Everyone has their own tag.  Just remember that focal lengths reported are true (well... there's a TINY bit of round-off allowed) and ignore the sensor size.
    Here's the background which may help you understand why this is.
    The "normal" focal length is based on the human eye, and to understand it, it's easier to think in terms of "angle of view" rather than "focal length."
    If you sit and stare straight ahead without moving your eyes or head to "look around", there is an area of vision that the average person can see (and it does vary), but the "angle of view" for that area is about 40 degrees (horizontally). Of course our vision doesn't present our brain with a nice little rectangular image... it fades and is irregular, but it's generally accepted that the angle of view covers about 40 degrees.
    The LENS that provides 40 degree angle of view coverage on a "full frame" camera turns out to be a 50mm lens.  Images taken with such a lens will seem neither stretched out nor compressed... they'll seem "normal" to your brain.  Also, if you can see an object without having to look around to take in the view, then your camera can "see" it with that lens.  
    A "full frame" camera is one which has a sensor size which is approximately the same as a single frame of 35mm film.  The dimensions are roughly 36mm x 24mm.  
    There are many different crop frame sizes, but for DSLR cameras, the most popular (by far) is the APS-C size.  This means the sensor is roughly the same size as a single frame for the "Advanced Photo System - Classic" film.   You can think of this as being roughly 21mm x 14mm (although it varies by a just a few millimeters -- on your camera it's really 22.3 x 14.9mm).
    If you were to use a movie projector and movie screen and you projected an image so that it fit perfectly on a 12' x 8' screen and called that "full frame", then a "crop frame" would be derived by shriking the movie screen down to about 8' wide by about 5-1/3' tall but (and here's the key) without doing ANYTHING to the movie projector.  Essentially that means you're projecting an image intended to fit ona 12x8' screen... but the real screen is smaller.  What happens to the part of the image that doesn't fit on the screen?    It just spills off the sides and is lost.  That is EXACTLY what happens inside a crop-frame camera.
    Canon EOS "EF" lenses are designed to project an image large enough to fill a full-frame sensor ... so when used on a crop-frame camera some of that image just spills off the sides.   This means that if your lens was providing a 40 degree angle of view (measured horizontally) then the crop-frame is only capturing the 26 degrees in the middle of it.  If you want a 40 degree angle of view again... you'll need to change lenses.
    And this is where your author suggests a 35mm lens is "normal" for a camera with an APS-C body.  The math actually works out in the neighborhood of a 31mm lens, but nobody actually makes a 31mm lens... and a 35mm focal length (commonly available) is pretty close.  Also 28mm lenses are commonly available and are ALSO pretty close.  It's my personal opinion that 28mm is probably a bit more normal than 35mm, but that's because as an avid amateur astronomer, I am fairly used to looking through Plossl design eyepieces which provide a 50 degree apparent angle of view and my eye actually can see the edges of the frame, but if I go a bit wider... I can no longer see the edges of the field without "looking around" (regardless... 40 degrees seems to be the established norm and THAT is the value that everything is based on.)
    For purposes of buying lenses, the focal lengths are NOT converted or adjusted in any way.  For example, Canon makes "EF-S" lenses designed specifically to work with their crop-frame bodies.  So when the kit lens that comes with the camera says it is a zoom with an 18-55mm focal length range... it really is 18-55mm regardless of sensor size.   (Canon isn't multiplying or dividing focal lengths and putting a different value on the box just because it's intended for a crop-sensor camera.)
    Hope this helps.
    Regards,
    Tim
    Tim Campbell
    5D II, 5D III, 60Da

  • I want to upload a Banner to my iTunes U page. The banner file has all the requirements like as, kind, size, frame, and etc. Infortunately,  I could not upload the file. It does not show in Provider Page Configuration or the preview.   Someone could help

    I want to upload a Banner to my iTunes U page.
    The banner file has all the requirements like as, kind, size, frame, and etc.
    Infortunately,  I could not upload the file. It does not show in Provider Page Configuration or the preview.
    Someone could help me?

    Sounds like a driver issue. I never tested in bridge, so I could be wrong. But it sounds to me that when you are connected to that screen, your settings are not set to the full resolution of that screen.

  • What are FIXED SIZE and VARIABLE SIZE

    Hi what FIXED SIZE and VARIABLE SIZE stands for when starting oracle instance?
    thanks in advance

    read this
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:365088445659
    Aman....

  • I converted video into frames. There is a big difference between video size(700 MB) and All frames s

    I converted video into frames. There is a big difference between video size(700 MB) and All frames size(More than 5 GB). What are the reasons ?

    Please, are you sure that you posted this in the correct forum? This is the Adobe Captivate forum, not a forum for video created with other applications like Premiere Pro.
    Lilybiri

  • [svn:fx-trunk] 13276: Min/ Max size fixes for AIR Window and WindowedApplication.

    Revision: 13276
    Revision: 13276
    Author:   [email protected]
    Date:     2010-01-05 07:18:31 -0800 (Tue, 05 Jan 2010)
    Log Message:
    Min/Max size fixes for AIR Window and WindowedApplication.
    AIR won?\226?\128?\153t allow you to set the min width greater than the current max width (same is true for height). You also can?\226?\128?\153t set the max width less than the current min width (same is true for height). The code that sets nativeWindow.minSize and nativeWindow.maxSize has been modified to take this into account.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-24566
    Reviewer: Corey
    Tests run: checkintests, apollo/spark/components/Window.as, apollo/spark/components/WindowedApplication.as, apollo/Window, apollo/WindowedApplication
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24566
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as
        flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as
        flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/Window.as
        flex/sdk/trunk/frameworks/projects/airspark/src/spark/components/WindowedApplication.as

    THank you , Nancy. Appreciate the input.
    So instead of this:
    <a class="brand" href="index.html"><img src="../img/logo-ca.png"alt="Consumers Advocate Review"> </a>
    Would it be something like this?:
    <a class="brand" href="index.html"><img src="http://ConsumersAdvocate/img/logo-ca.png"alt="Consumers Advocate Review"> </a>
    And if I do that, is there a way to cope with that locally so that DW can still display the images?
    jeff

  • How do I fix problem with linked and cropped image frames not printing properly when spanning pages?

    We are using InDesign (ID) to develop and print church bulletins which contain a combination of text frames and graphics. One of the graphic types we use are TIF files which are high-resolution scans of hymns.
    A hymn usually has a combination of the musical score, plus the lyrics - with many verses., so the modular structure is 'staff' composed of a treble clef, followed by verses, followed by a base clef.
    If the example above had 6 verses instead of one, we would crop the image by adjusting the frame, so that the treble clef and the desired verses showed through the frame.
    We would then copy and link the frame - piggy back - adjusting the next content window etc....so we build a custom version of the music as a series of linked frames - each with the same base image, but a different frame position.
    So this works fine, when we do this on a single page, but when we then add a 'last staff' at the top of the following page, we encounter print problems with some output devices.
    Imagine a two-page spread, with a full page of music on the left, and the last staff (treble clef, verses, base clef) unit as a separately linked frame at the top of the right page of the spread.
    It displays correctly, and will print individually as pages correctly, but when we print it as a booklet, the last frame drops out and we have blank space.
    I can print the document to PDF and it works fine, but if I print it to a copier or laser printer I get drop out.
    It is inconsistent.
    Previews are always okay. Individual page prints are okay, but when you print the entire document, the last frame in this kind of linked series gets blanked.
    If we create and name the image differently, and call it in as a new image - (not linked to the previous), but it is still a large image that is cropped to a small piece, then it doesn't print.
    If we save the last frame as a different image type (take the TIFF file into photoshop, crop it and save it as a jpg - so it is only the 'snippet') and then import it, it works fine.
    So my question to you InDesigners....is there some setting or tip or trick I need to know to be able to link a series of frames with the same base image, but different crops and make it span across two pages properly.
    Or do we need to play this game of crop and trim the image so that it doesn't drop out?
    Any thoughts, advice, direction would be gratefully received!

    I did a lot of such hymn things in the past, but I was alway working on the scans in Photoshop, like adjusting, retouching spots and cropping. And I was always seperating those images to be more flexible so I never run into such a problem.
    I am always scanning in a higher quality level than I would need, I scan it in color, this allows me to eliminate paper color easily, even if I need 1-bit images at the end, I do it in color, so I can also turn the image.
    I did once run into a similar problem with a scan I have got from a copier-scanner machine (it was not a song). But saving as PSD resolved my problem.
    So I would suggest: Open your files in Photoshop, resave them as PSD files and use those instead. If you use 1-bit images (which is fine for this type of images) you should use a resolution equal to the printer's resolution.

  • 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."

  • Fixed space with frame

    My query is related to frames. Can it be taken as a thumb rule that whenever we put a frame with its vertical and horizontal elasticity as fixed which is the default, it will take that much of fixed space in the report. Please help me in this as it is very urgent.

    Yes. If you have a fixed size frame it will take up that much space in the output.
    However, if you have objects within the frame then the fixed size frame will repeat across multiple pages until the content within the frame completes formatting.

  • 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.

  • Best way to create a fixed size centered Panel?

    I'm trying to figure out what the best way is to create a fixed size Panel that stays positioned in the center of its parent component/panel, even as the frame is resized. Is there a way to do this with some layout or will I need to write some code to reposition my panel each time the frame is resized?
    Thanks
    Jonathan

    This approach seems good. One thing I'm wondering, why does the GridBagLayout draw my Panel based on the preferred size and not the bounds? If I want to do some sort of fancy painting with my panel, I'll probably have to set the bounds as well I'd think.
    jonathan
    Here's a way. I won't go so far as to say "best",
    but it gets the
    job done. You need to control the layout of the
    parent in order for
    any solution to work -- some layouts will ignore the
    preferred,
    maximum, and minimum sizes of their components.
    import java.awt.*;
    import javax.swing.*;
    public class CenterTest {
         public static void main(final String[] argv) {          
              final JPanel fixedPanel = new JPanel();
    fixedPanel.setPreferredSize(new Dimension(100,
    0, 100));
              fixedPanel.setBackground(Color.BLUE);
    final JPanel panel = new JPanel(new
    ew GridBagLayout());
              panel.setBackground(Color.CYAN);
              panel.add(fixedPanel);
              final JFrame frame = new JFrame("GridBagLayout");
              frame.getContentPane().add(panel);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
              frame.setSize(200, 200);
              frame.setVisible(true);

  • A Q about i-frame and p-frame

    http://www.interactivetvweb.org/tutorial/mhp/javamedia.shtml
    in this tutorial, at the end, it talks about i-frame and p-frame.
    i have an xlet that will need to switch iframe backgrounds very often. this p-frame idea will save the memory.
    so anyone has tried it?
    can provide at least a pseudocode?

    I have known how to display i-frame read from a one-frame-only m2v file, which is the epg.m2v in the code below.
    but after this, i can't even switch to other channels, seems like machine is hanging, have to reboot.
    i am asking what causes this and how to display a p-frame on top of the iframe.
    my code is as below:
    ////////////////////////start***********************/////////////
    scene.setVisible(true);
    g = scene.getGraphics();
    MediaLocator myLocator;
    DripFeedDataSource dripSource=null;
    Player player=null;
    MediaLocator driplocator = new MediaLocator("dripfeed://");
    try
    dripSource = (DripFeedDataSource) Manager.createDataSource(driplocator);
    player = Manager.createPlayer(dripSource);
    catch(Exception e){System.out.println(e.toString());}
    if (player != null){
    player.realize();
    player.prefetch();
    player.start();
    try {
    int size,size1;
    InputStream in = new FileInputStream("epg.m2v");
    InputStream in1 = new FileInputStream("small.m2v");// trying p-frame
    size = in.available();
    size1 = in1.available();// size of p-frame
    byte[] frame = new byte[size];
    byte[] frame1 = new byte[size1];// array of p-frame
    in.read(frame);
    in1.read(frame1);//read p-frame
    in.close();
    in1.close();//close reading
    if (dripSource != null)
    dripSource.feed(frame);
    Thread.sleep(3000);//as spec says don't feed again within 500ms
    dripSource.feed(frame1);//feeding p-frame?
    Thread.sleep(10000);
    player.stop();//can this stop it? coz i can't switch channels any more
    catch (Exception ex) {
    ex.printStackTrace();
    ////////////******************ends******************/////////
    thanks

Maybe you are looking for

  • How can I force an app to re-sync/update without removing it.

    I am developing an app for the iPhone using Flash CS5.5 Everything time I publish the ipa, I have to remove it from the phone and then re-add it, thus deleting any save information on the phone. Is there is a way I can get iTunes to "update" the appl

  • How can I make slides into movies to show on DVDs?

    I have just scanned about a thousand of my 91 year old Dad's slides and have been trying to transfer them to discs, so that they can be easily played on a DVD player so that he doesn't have to go through that oldfashioned slide show procedure with th

  • MacPro keeps killing hard drives!

    Hi all, I had a search on here beforehand to see if anyone else has had this issue. I couldn't find a close match, but my apologies if I missed one. I have an early model Mac Pro (v1.1) and last week the original hard drive (a good 6 years old) sudde

  • Junk mail and spam - learning mode?

    Have been receiving unsolicited stock picks and viagara offers and move them to junk email folder that I created. Someone mentioned on a forum that a .mail account has a learning mode to help filter spam. I can't locate it. Any suggestions? Thank you

  • Pixel bender error in ps cs4

    first off specs of my system I am running a kit with an asus dx58so mobo, I7 core, 6gb ddr3 ram, dual geforce gtx 295 graphics card (triple monitor setup two hp and a wacom cintiq) with two 1tb sata harddrives, xp pro 64bit. I have web design premium