MaxScale fixed with variable height?

I need to resize my image to have a width of 155px and the height automatically adjusted to scale.
e.g.
image 1: 300px(w)x100px(h) = 155px(w)x103px(h)
image 2: 100px(w)x300px(h) = 155px(w)x233px(h)
also I need to create a fixed 66px(w)×49px(h) thumbnail. The thumbnail needs keep its aspect ratio and crop it to 66x49.
Is the above possible?

As far as I can see, a JTextArea doesn't work if the lines wrap. I can add line wrapping to the JTextArea by setting jta.setLineWrap(true); but then the height of the window is wrong:
import java.awt.*;
import javax.swing.*;
class Xyzzy {
        private static JFrame frame;
        private static JComponent cPane; // Content pane
        public static void main(String[] args) throws Exception {
            SwingUtilities.invokeAndWait(new Runnable() {
                public void run() {
                    frame = new JFrame("XYZZY");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    cPane = (JComponent)frame.getContentPane();
                    cPane.setLayout(new BoxLayout(cPane, BoxLayout.Y_AXIS));
                    String str = "This is a text string which is to be repeated several times ";
                    JTextArea jta = new JTextArea();
                    jta.setEditable(false);
                    jta.setLineWrap(true);
                    for(int ii = 15; ii --> 0; ){
                        jta.append(str + str + str + str);
                        jta.append("\n");
                    cPane.add(jta);
                    frame.setMinimumSize(new Dimension(800, 0));
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
Claus

Similar Messages

  • Accordion with variable height

    Hi -
    I have a 2-panel accordion with variable heights, and spry
    data in both the top and bottom panels. Selections made in the top
    panel will load data into the bottom panel, and the page opens to
    the top panel by default. My problem is that the bottom panel will
    only display enough height to show the initial HTML markup, and not
    the spry data generated after the initial page load. Is there any
    way to use an observer to "refresh" the accordion to reset its
    height to accommodate the new data?
    Also, is there a way to require that at least one panel
    remain open when using variable heights?
    Thanks in advance,
    Rod

    Hi,
    We have a similar question on this
    post.
    To fit exactly with your request you should change the line:
    regionHeight =
    document.getElementById("myRegion").scrollHeight;
    with:
    document.getElementById("myRegion").style.height =
    document.getElementById("myRegion").scrollHeight + 'px';
    Diana

  • Tabular report with variable-height 2nd line?

    I have a simple tabular (Tablix) report.  The last field is a message (varchar(1000)) which I would like to place by itself on a second line (while still preserving the tabular format), with variable height.  
    The problem is, when I add a second row to the detail region, I can add the message field, but it is limited to the size of the field just above it.  I'm trying to allow that message field to take almost the entire width of the second detail line.  Can
    this be done?  
    Thanks.

    If you add a row inside the Details group, then select all cells inside the details group that are on the new row, you should be able to merge cells by right-clicking and choosing merge cells.
    You cannot merge cells across different scopes (row groups, column groups, etc) so be certain that you are not selecting cells that span different groups.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Start with all Accordion panels closed with variable height panels

    I inserted a Spry Accordion on this page: http://www.brucebarrdesign.com/video_new.htm
    I want the panels to open to a size depending upon the content within them so I set the height to auto. The problem is that when you go to the page, the first panel is open. I want all of the panels to be closed when you first go to the page. Per the Help docs and some posts I've seen in the forum, I tried inserting this code:
    <script type="text/javascript">
    var acc1 = new Spry.Widget.Accordion("Acc1", { useFixedPanelHeights: false, defaultPanel: -1 });
    </script>
    However, this only works with fixed height panels. If I use it with the variable height, it opens all of them, so I commented it out for now. How can I get this to work?
    Thanks

    GPDMTR25 wrote:
    I located the answer to my own question (how to get all the accordion panels to remain closed when the browser opens) but I still don't understand the answer. Can someone explain this?
    This feature is only supported when using variable height panels, so you must pass a false into the Accordion's constructor for the "useFixedPanelHeights" constructor options, and a -1 for the "defaultPanel" option:
    <script type="test/javascript">
    var acc1 = new Spry.Widget.Accordion ("Acc1", { useFixPanelHeights: false, defaultPanel: -1});
    </script>
    Angela
    Hi Angela,
    You are right, the only way it will work is by setting the fixed height to false. As for the for the default panel option, -1 is not a panel and if you had 3 panels we could have used the number 3 (panel1 = 0) or 99 or whatever as long as there is no panel with that number. If we had used the number 1 for instance, then the 2nd panel would be opened by default.
    Hope this helps.
    Ben

  • TileList with variable height renderer example?

    I am desperately searching for an example of how to implement
    a TileList with a variable height renderer. Well I guess to be more
    clear, I am sort of able to do this, but I have a renderer that
    uses a VBox, then an mx:Image. My single column TileList will hold
    a collection of images, that are all scaled to the same width. I
    need the height of the renderer to be based on the scaled height of
    the image.

    Google "FlowBox".
    Tracy

  • Keeping at Least One Accordion Panel Open with Variable Heights

    Hi -
    Is there a way to keep at least one panel open when using {
    useFixedPanelHeights: false }?
    Here's an example:
    http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample.html#VariablePan elHeights
    If panel 4 is open, and you click the panel 4 heading, it
    closes and no
    panel is open.
    Thanks,
    Rod

    Sorry, I didn't read my full message regarding wanting only
    one panel to open.
    What I ended up doing was using a PHP conditional to display
    a message if a certain variable was not passed in the URL. See my
    post on the Friends of Ed forum. Scroll to the bottom for my
    solution.
    http://friendsofed.infopop.net/4/OpenTopic?a=tpc&s=989094322&f=5283032876&m=3461018571

  • Subreports with variable heights

    How do you get subreports to print one after the other when
    the height of each subreport varies? Each subreport appears on the
    page in an absolute position.

    Found the answer in the help file in the Properties reference
    section:
    Position Type: = Float - The element moves down as elements
    above it expand. It attempts to preserve the distance between it
    and elements above it.

  • Variable Heights Panels Accordion

    I have an Accordion with variable heights panels .
    Is it possible to have at least one panel always open as the
    fixed height panel behaves.
    At the moment if I click the open panel it closes.
    My Test
    Page Here
    Thanks,
    Richard

    Hi Steven.
    Could you please provide the URL of the page where we can check it.

  • Tabbed panel with adjustable/variable height based on content

    Is there anyway that you can create a tabbed panel with adjustable/variable height based on content in each tab?

    Abhishek,
    Thanks for your reply, however, it is not working with Muse. I added the Javascript to the head section and adjusted iframe and it displays as a small square in the upper left hand corner, unable to view the whole page.
    Inserted into head section --
    <script type="text/javascript">
       function resizeIframe(obj)
      obj.style.height = 0;
      obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
       </script>
    inserted as an html object --
    <iframe name="MycoSmooth" src="http://www.mycosmooth.com" frameborder="0" scrolling="no" id="iframe" onload='javascript:resizeIframe(this);' />
    Below is the result:
    The purpose is to have an independent website run the blogging capabilities, since muse doesn't directly support blogging as of yet.
    Since the site is on a different domain, I am running into cross domain issues and it won't get the height of the page. The methods that apparently work use php and I am unsure how that would work in muse, if at all.

  • Fixed and Variable Breakup of Actual Cost

    We have implemented Material ledger and also activated actual cost component split. We are getting the actual product cost at month end. In the costing cockpit we get the Peiodic unit price(Actual cost) as well as std price of the material. But In costing cockpit we are not able to get the breakup of Fixed and variable. Whereas we are getting Fixed and varible breakup when we check cost component report in ckm3. But there, we can see individual material wise fixed and varibale breakup.
    Can anybody help me so that I can see the Actual Fixed and variable cost for all the products at a time?
    With regards
    Mukesh Poddar

    Fixed price, is the fixed costs - I usually see it in relation to Overhead..
    Fixed costs remain, whether you manufacutre or not.
    Say you are deciding whether to out-source an assembly,  If you outsource, VARIABLE cost will be saved, Material, labor for that assembly, Overhead representing fringes for that labor, the electricity to run that specific machine.  However, you will still have fixed costs of: Management Salary (although some of that can be variable); insurance on the building; heating and cooling for the building; realestate taxes.
    If the cost to make "in house" is 150 each and the vendor is going to charge you 100, thi is only a true saving if your fixed costs are less than 50.
    SAP allows you to separate fixed and variable costs so that you do make/buy analysis, budgeting, etc
    Hope this helps
    Edited by: Althea Madigan on May 12, 2010 2:11 PM

  • Problem with variable in the woorkbook selection screen.

    Hi All,
    I have Problem with Variable in the selection screen. I have four variable in the report in this sequence
    <b>Plant (optional), calendar month (mandatory),  material (optional), Customer (mandatory). </b>
    In Development system, I changed the query to fix the problem for a formula. saved and executed the query. In the selection screen appeared four variables and executed. after executing the query and I saved the work book also. I logged out of the Bex Analyzer. In the RSRT I generated the report by clicking the Generated Report push button. and again logged into the Bex analyzer and ran the work book, now in the selection screen, appeared three Variables only, I am missing the variable <b>Customer</b>.
    The old report which is already  in the Production system is working fine. What could be the mistake I did in the development system.
    It is very urgent, I need to deliver this object as soon as possible.
    Can I anybody help on the same.
    Thanks in advance
    Narendra

    Yunus,
    I did what you said. I removed the variable from characteristic restrictions, saved the query and executed the query, appeared three variables Plant, Calender month and material. executed and saved the work book. disconeted from Bex analyzer, in RSRT Generated Report and logged into Bex analyzer ran the work book for selection Plant, calender month and material and went into change query definition and added the variable for customer which was removed earlier and and ran the query for selections Plant, Calender monmth, Material and customer. saved the work book. disconnected from Bex analyzer and closed all excel sheets and work books. In RSRT Generated Report and again connected to Bex analyzer and ran the work book, now appeared only three variables again missed variable customer.
    Yunus does any missed n the procedure what i did.
    It is helped what Chris was answered.
    Many Many Thaks for your time and replies.
    Thaks in advance
    Narendra

  • How to use wild card with variable in powershell

    HI
    i am trying to use wild card with variable but getting an error message, "You cannot call a method on a null-valued expression."
    $src = 'C:\Temp'
    $TabletzipPath = $src + "tab*.zip"
    i would like to copy the tablet zip file which is placed in in $src to be copied in $TabletzipPath.
    i am using tab* because this file name changes continuously. so if i give a fix name for example tablet1.zip than it works fine.

    Not sure if the wildcard will work without seeing how you're using the variable.
    That said, I can say that it looks like you're missing the backslash between the $src path and the wildcard filename. As-is the above code assigns a value to $TabletzipPath of "C:\temptab*.zip" instead of what you are likely expecting ("C:\temp\tab*.zip")
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Problem with Variable Entry Screen

    Hello All,
    We upgraded our development systems to NW2004s and came across the following issue:
    All our Bex queries have restricted time characteristics with variables entries. When we execute a query it should pop-up the variable selection screen for us to enter the restriction values but the query is ignoring Variable restriction screen and taking into consideration everything. The same query works fine in Prod., which is still in 3.1.
    Did anyone come across this situation kind of situation? It did not pop-up any type of error and we are in SPS10
    Thanks in Advance,
    Message was edited by:
            bw expert online
    Message was edited by:
            bw expert online

    We fixed the "Variable Screen not appearing" problem by adding following objects to our users.
    1) Business Explorer - BEx Web Templates (NW 7.0+) S_RS_BTMP
    2) Business Explorer - Individual Tools S_RS_TOOLS
    3) Business Explorer - Data Access Services S_RS_DAS
    Mark the message answered if this helps.

  • How to set the variable height for TileLayout

    Hi,
    I am using TileLayout in  <s:List> component . TileLayout takes the maximum height of the children and draw the same height for rest of the children in all rows. Instead, I want to have all the rows with various heights if their children have different heights.
    I know there is variable height property in <mx:List> component but which is not there in its spark counterpart. Can you please help me with this issue??
    Thanks,
    Bhoja

    The spark TileLayout class lays out all of its elements in equally sized "cells".  Cells of variable sizes is not currently supported.

  • Using alerts with variables-"dynamic text" not working

    Hello all,
    I'm triggering an alert from a BPM, and have set the flag "dynamic text" on for the alert category associated with it. I'm doing it in a similar way to the blog 1382 by Michal:
    [/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated|/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated]
    The only difference is that I'm just assigning a fixed text instead of a payload element to the container element, which I've defined as simple type - string.
    However, the text of the alert doesn't show anything. I'm getting an email with just "Process <id>" as the subject and "Alert ID: <number>" in the body of the email (the same in the Alert Inbox).
    I'm starting to think that there could be something wrong in PI 7.1 which I'm using, as I've configured other alerts in scenarios without BPM without problem.
    Thanks for your suggestions!

    I've solved it using an alert from the Enterprise Services Builder (Integration Repository). It's a new feature in PI 7.1. It seems the tab "Container" in the alert category didn't exist before (that's why you don't find it in the weblogs of Michal and others) and now you have to use it.

Maybe you are looking for

  • I lost an album off my iTunes list, but I have the email from Apple with the receipt of the purchase. Can I get the album again for free?

    I have a new macBook, so backed up my iPad first time in two years. Lost a James Taylor album I purchased in July 2010. I still have the reciept email form Apple thanking me for buying it on iTunes. Its not showin in my purchased folder. Can I downlo

  • Bug in JSpinner / SpinnerNumberModel

    if use following constructor and pass BigDecimal instances for the four arguements then it accepts but on increasing value it throws ClassCastExecpetion. public SpinnerNumberModel(Number value, Comparable minimum, Comparable maximum, Number stepSize)

  • How to format a msi gx660

    I have recently bought an msi gx660 but if in the future i will need to format how i can do???I can boot up winows 7 by a pendrive format and install windows 7 or i must use the recovery mode at the boot???

  • Time mgmt

    HI, How to retrive the time management data from the cluster.Can any body explain the process and procedure. And how run the time mgmt data ,time evaluations with t-codes .also.Please help in this case ? Please go through the relevant SAP help Edited

  • I am unable to use my bookmarks since IIS comes up on my screen.

    IIS is interfering with my use of bookmarks. When the IIS appears it is like greek. The only word I can read is welcome which goes to another screen, none of which I want to use. How do I reach my bookmark for my bank so that I do my bill pay?