Auto resizing of non-resizeable controls

Is it possible to have controls which by default are not resizeable (e.g. ImageView, MediaView) to be automatically resized as their parent node is resized? If so, how can this be achieved?
Thanks,
-Luc

It is possible, with a trick. What I do is wrap the ImageView into a ScrollPane, and then bind their properties together so that the ImageView tracks the size of the ScrollPane. Here's an example:
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setContent(new ImageView() {{
        imageProperty().bind(poster);
        setPreserveRatio(true);
        setSmooth(true);
        fitWidthProperty().bind(scrollPane.widthProperty());
        fitHeightProperty().bind(scrollPane.heightProperty());
    }});It shouldn't be too hard to change this into a generic Wrapper cllass that takes a ImageView or MediaView as parameter.

Similar Messages

  • 'Auto resize image' 'Settings' dialog box controls

    I have a signature that contains an avatar image (size 120px by 120px)
    Every time I 'Send' an 'Auto Resize Image' > 'Settings' dialogue box pops up
    How can I bypass this as its becoming annoying.
    Most emails (98%) do not contain any other embedded or attached images.
    This only started to happen after upgrading to latest version of Thunderbird, was never an issue before.

    Doesn't sound like a standard Thunderbird pop up as I've not come across it.
    Do you by any chance have an addon /extension such as Auto Resize Image?
    * https://addons.mozilla.org/en-US/thunderbird/addon/auto-resize-image/
    if yes, disable it and retest to see if message stops.
    Check you are using an up to date version.
    check to see if there is some settings you can use to 'not ask again' or similar. Can't say exactly as I do not use it.
    I use the standard TB settings to adjust for sizing when I originally insert an image.

  • Auto resize width height in TextFlow controller

    HI,
    We are facing the problem in auto resize width height in TextFlow controller. Content is overlaping withing the controller or sometimes it's seems like not full containt displaying on the control.
    We are writing the below code in the flashx.textLayout.events.CompositionCompleteEvent listiner to orgnize the above step:
         var controller:ContainerController = new ContainerController();
         textFlow.flowComposer.composeToPosition();
         var contentBounds:Rectangle = _controller.getContentBounds();
       _controller.setCompositionSize(_controller.compositionWidth, contentBounds.height);
       textFlow.flowComposer.addController(_controller);
       textFlow.flowComposer.updateAllControllers();
    Please correct if are missing any steps above.
    Regards,
    R.BS

    Hi,
    I have got the solution on my last query. Below is the code to get rid of the content display and auto adjust the width & height of the controller:
    var textHeight:int = Math.ceil(_controller.getContentBounds().height);
       if (textHeight > _controller.compositionHeight) {
         TextDataHeight = textHeight + 12;
                   _controller.setCompositionSize(TextDataWidth ,TextDataHeight);
                   textFlow.flowComposer.updateAllControllers();
    I have also set the TextDataHeight = 50 to display complete paragraph text.
    Due to this I have one problem arise that is indentation of the paragraph content or bulleted text on my content.
    Is any one have the solution on this?
    Looking forward for your response.
    Regards,
    R.BS

  • Stop auto resize on mplayer? [solved]

    Hi does anyone know how to stop mplayer from auto resizing when you load a video??
    I have searched everywhere and i am suprised it's not an option in preferences
    Cheers
    Last edited by joco2 (2007-08-12 12:07:25)

    I am pretty sure mplayer resizes itself in order to have one monitor pixel per one movie pixel in one dimension and the other dimension is calculated differently if the movie uses non square pixels (like DVDs).
    About your problem, try reading -vf scale in mplayer man.

  • JTable in JScrollPane auto resize refresh problem

    Hello,
    I have a JTable in a JScrollPane. Number of rows is changing.
    I'm using the following to auto-resize JScrollPane.
    public Dimension getPreferredSize() {
                  Dimension size = super.getPreferredSize();
                  size.height -= getViewport().getPreferredSize().height;
                  Component view = getViewport().getView();
                  if(view != null)
                  size.height += view.getPreferredSize().height;
                  return size;
             }There is a JButton, which adds an empty row to the JTable. It all works fine, except the auto-resize when a new row is added. I want all rows of JTable to be visible, with no scrollbars present. I tried repaint(), revalidate(), addNotify(). What should I do?
    Thanks.

    Sure
    DefaultTableModel dtm = new DefaultTableModel(vec, header);
              jt0 = new JTable(dtm);
              jt0.getTableHeader().setReorderingAllowed(false);
              jt0.setFont(new Font("Tahoma", Font.PLAIN, 12));
              jt0.getTableHeader().setFont(new java.awt.Font("Tahoma", java.awt.Font.BOLD, 12));
              jt0.setRowHeight(18);
            jt0.setPreferredScrollableViewportSize(new Dimension(500, jt0.getRowCount() * jt0.getRowHeight()));
            jt0.setFillsViewportHeight(false);
              jsp0 = new JScrollPane(jt0);
    GridBagConstraints gbc = new GridBagConstraints(); 
            gbc.insets = new Insets(2,1,2,1); 
            gbc.weightx = 1.0; 
            gbc.weighty = 1.0; 
            JPanel p0 = new JPanel(new GridBagLayout()); 
            gbc.fill = gbc.HORIZONTAL;
            p0.add(jsp0, gbc);
              JButton jb1 = new JButton("add row");
              jb1.setSize(40, 18);
    jb1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(java.awt.event.ActionEvent e) {
                        dtm.addRow(new Object[]{....});
    //                    jt0.scrollRectToVisible(jt0.getCellRect(jt0.getModel().getRowCount()-1, 1, false));
    //                    jt0.setRowSelectionInterval(jt0.getModel().getRowCount()-1, jt0.getModel().getRowCount()-1);
        public class SizeX extends JScrollPane {
             public Dimension getPreferredSize() {
                  Dimension size = super.getPreferredSize();
                  size.height -= getViewport().getPreferredSize().height;
                  Component view = getViewport().getView();
                  if(view != null)
                  size.height += view.getPreferredSize().height;
                  return size;
        }

  • Auto resize webpage?

    i have just finished my site which can be seen here www.jbpermanentcosmetics.co.uk The site looks fine on my Macbook pro on Mac and windows but it is way too large for 4:3 monitors. The site width is 1200 which in hindsight is too large really but i don't want to have to resize the whole website. Is there any HTML code which i can add which will auto resize the page to avoid horizontal scrolling?

    rossn49 wrote:
    I found the following code which looks like it might do what i want:
    <SCRIPT language="JavaScript">
    <!--
    if ((screen.width>=1024) && (screen.height>=768))
    window.location="highres.html";
    else
    window.location="lowres.html";
    //-->
    </SCRIPT>
    rossn49, you can not use that javascript. It switches between two pages/sites (I bolded the code), which means you have to add another site with narrow width.... you indicated that you wouldn't like to do that.
    However, you can find the sweet spot for your site design; many people started to design their sites for regular computer and also accommodate mobile devices such as iPhone.
    You may like to do just that, iPhone's resolution is 960px wide, so I would conservatively take it down to 900px~920px wide.
    OT, thanks for the good words... I'd not read the forum today. I'd been spending time today to figure out and mount my GPS on my new motorscooter, maybe I will buy motorscootersaurus.com for my new site. LOL!

  • How can I disable the auto resizing in NetBeans?

    Hello,
    how can I disable the auto resizing in NetBeans?
    I cannot resize nor displace components due to this automation.

    first what do u mean by auto resizing ? if u mean the layout that automatically aligns itself then ..... if that's yr question then u need to set the layout to null
    if using netbeans then right click on the the mainPanel and setlayout to null if eclipse the frame.getContent.setlayout(null);
    NetBean doesn't have a forum it has mailing list u can subscribe there
    http://www.netbeans.org/servlets/TLogin
    Edited by: raven_roy on Mar 12, 2008 2:58 AM

  • Auto-transfer of Non-Moving items

    Hi,
    Is it possible to Auto-transfer of Non-Moving items to one location from another location, once the material is not consumed for more than 3 months.
    Regards.

    HI,
       As of my knowledge, there is no standard transaction to check and transfer the material automatically. Last material movement can be found from S031 or S032 table.  You may create a custom program with the BAPI: BAPI_GOODSMVT_CREATE. and schedule the job for a specific time period. Refer the doc: How To Goods Movements with BAPI - ERP SCM - SCN Wiki
    Regards,
    AKPT

  • Auto-resizing all components

    Is there a method that auto resizes all components on a JFrame when it is maximised for example. I have got a JTable (in a scrollpane) and some other components on a panel. I have sized the frame to be approx 80% of the screen size. When the frame is maximised, the table and the other components retain their original size (understandably so!). Is there a method available that can resize the panel and its components to resize accordingly when the frame is maximised?...I know I can add the componentListener and implement a method in the componentResized() method...but I dont want to duplicate stuff that's already available. Thanx for your help.

    I don't know the specific needs.
    BorderLayout: simple Layout; Components are oriented NORTH, EAST, SOUTH, WEST
    FlowLayout: all components are added after the other
    GridLayout: components are oriented in a grid
    GridBagLayout: complex once
    See the Java Tutorial for more information.

  • Auto Resize Text in a Text Box

    How do you make the text inside of a text box auto resize to fit the box I'm typing in?
    I have a text box with a list in it. I change this list everyday and like the text to fit the box. The size of the text doesn't matter. If I have a long list, I don't mind that the font is small. If I have a short list that day, I don't mind that the font size is then big. Hopefully I am making sense. I used to use text boxes like this in MS Publisher and am assuming I just need to find a setting change in Pages.
    I do this often enough that it would save time not having to keep guessing the correct font size until it fits properly.
    Thanks!
    Message was edited by: mnbinth

    mnbinth wrote:
    I used to use text boxes like this in MS Publisher and am assuming I just need to find a setting change in Pages.
    Assuming that application B will behave the same than application A is always a bad idea.
    There is no reason for such a guess.
    Happily, all engineers aren't thinking the same way and remember Apple's statement :
    *_Think different !_*
    Yvan KOENIG (VALLAURIS, France) samedi 25 septembre 2010 10:55:56

  • How to avoid auto resizing the JPanel

    I have JFrame as main window. This JFrame consist of statusbar at the bottom of the JFrame. The statusbar has implemented as a panel that uses BorderLayout. This statusbar has two JPanels as children.
    1) the first child panel(label panel) has 3 labels on it.
    2) the second child panel(image panel) has only one label with a image and this second panel is added to statusbar to the next of the first child.
    3) all panels use BorderLayout.
    If I resize the JFrame by dragging its right border (right to left) both the panels on the statusbar are auto resizing. But I don't want to resize the image panel on the statusbar. I mean even if I resize the frame the size of the image panel should not change. It has to always visible completly.
    Any help is heighly appreciated.
    Regards
    Venkat

    There could be several different ways to achieve this, but it all boils down to using appropriate layouts and/or preferredSizes.
    The Java&#8482; Tutorials: [Laying Out Components Within a Container|http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]
    db

  • Something is wrong with Firefox's image auto resize

    In forums, when I post an image, it's seems to be doing an incorrect image auto resize, for the image is still large to be fit in the websites' pages, and when I CTRL+Scroll, the browser makes a proper resize though making the letters and numbers smaller.

    Resizing images automatically only works if you open an image in a tab and there is only that image to be shown. In all other cases it is the website that determines how large an image is displayed.<br />
    If you post an image on a forum and the forum doesn't resize the image automatically then use an upload host that automatically generates a thumbnail that you can show and that opens the full sized image if you click the thumbnail.

  • Auto-resizing TextArea in Flex 4

    Does anyone know how I can auto-resize the height of a Spark TextArea please? I tried following the examples in http://forums.adobe.com/thread/748191 but couldn't get it to work in either Flex 4.1 or Flex Hero.
    Here's what I'm doing:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:TextArea width="100%" heightInLines="{NaN}" minHeight="50"/>
    </s:WindowedApplication>
    When I press enter I need the TextArea's height to auto-resize, rather than scrolling up/down. Any help appreciated.

    @jeffry
    it surprises me too - but try this: http://polygeek.com/2249_flex_display-html-text-in-the-spark-textarea

  • How do I turn off "image auto-resizing"?

    After upgrading to version 3.6.3, the browser is now auto-scaling my images. I turned off "auto-resizing" on the About:Config page (in other words, setting that parameter to "false") but Firefox is still auto-scaling my images. How can I prevent this?
    == This happened ==
    Every time Firefox opened
    == I upgraded to version 3.6.3

    If you have set the pref '''browser.enable_automatic_image_resizing''' to ''false'' on the '''about:config''' page then Firefox shouldn't resize images.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    Reset the page zoom on pages that cause problems: '''View > Zoom > Reset''' (Ctrl+0 (zero); Cmd+0 on Mac)
    See [[Text Zoom]] and [[Page Zoom]] and http://kb.mozillazine.org/Zoom_text_of_web_pages
    .

  • Auto resize columns.

    How can i get finder to auto resize my columns in columns view?
    (I know how to option-click resize them)
    best...Jan

    to resize the grey bar on the left, all you need to do is move the arrow to the line on the edge of the box, the far right line and the little symbol that allows you to adjust windows appears and then you can adjust it to any size of your preference. as for the auto-sizing columns, i don't even know how to change the size so i wouldn't know how to auto size it...sorry. hope that helps
    regards,
    thealexness

Maybe you are looking for

  • Missing Fonts in PDF

    Hello everybody I have a font problem somwhere in the chain Powerpoint->PDF->InDesign. When i Import the generated PDF, InDesign is reporting missing fonts in it. Now, there is a difference in which and where the fonts are missing (11 vs 31 errors) d

  • SB-Z. Audio missing in some Chrome tabs but not other. Also some sounds in X-Plane.

    I just installed a Z that I got a while back (my son, shall we say, wondered off with it for a bit). However, I'm having issues with it. The first thing I noticed is that, after setting it up and making sure it's set up correctly in the BIOS (Asus Ma

  • Bold text does not display in internet browsers

    I am working on editing a website for a client that I did not originally create so I am having trouble trying to figure out what the previous designer did. I need to make certain text within paragraphs bold, which I normally do by inserting <b> </b>

  • Mac Pro GeForce GT120 Unable to select 1680 x 1050 resolution

    Hi all - I've got a brand new Mac Pro with current OS on it. It has a Geforce GT120 video card, and I've hooked up an NEC 203wxm monitor using a Mini Display Port to VGA adaptor. Now, I can't select the native resolution of the display (1680 x 1050)

  • Loading iTunes on portable hard drive

    Hi, I've run into a problem that I can't seem to find an answer myself. I have a MacBook and have had my iTunes loaded on a Toshiba 250 GB portable hard drive. Everything was working fine when I wanted to play my iTunes I needed to have the portable