MinWidth = USE_COMPUTED_SIZE is ignored?

I want to lay out a simple HBox like this:
[label1] [label2...] [label3]
I want label3 to be right-justified, and I am more interested in seeing the contents of label1 and label3 than label2 when the container shrinks. So naively, I'd think that I should set minWidth = USE_COMPUTED_SIZE for the important labels, and to make label3 right justified I'd set HBox.hgrow=ALWAYS for the middle label:
<HBox xmlns:fx="http://javafx.com/fxml" spacing="5">
  <maxWidth>
    <Double fx:constant="MAX_VALUE" />
  </maxWidth>
  <Label fx:id="label1" text="Important Label">
    <minWidth>
      <Pane fx:constant="USE_COMPUTED_SIZE" />
    </minWidth>
  </Label>
  <Label fx:id="label2" text="Vastly less important message" HBox.hgrow="ALWAYS" />
  <Label fx:id="label3" text="Important Label">
    <minWidth>
      <Pane fx:constant="USE_COMPUTED_SIZE" />
    </minWidth>
  </Label>
</HBox>But that doesn't work in either respect! label3 is not right-justified, and labels 1 and 3 shrink to ellipses as fast, if not faster, than label2 when I make the window narrower. A little experimentation reveals that setting a large maxwidth on label2 achieves the right-justification that I want, but minwidth is still a problem.
On closer inspection, I find that USE_COMPUTED_SIZE (-1.0) is actually the default minwidth! What good is that?
If instead of using USE_COMPUTED_SIZE, I simply set the minwidth of labels 1 & 3 to a real value like 99, they do indeed shrink later than label2 does. But of course, I don't want to hard-code a minwidth like that. What am I supposed to do?

Try something like the following.
Load it up in SceneBuilder 1.1+ and then choose Preview | Preview in Window and resize the preview window to test out the resizing behaviour:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<StackPane id="StackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="39.5" prefWidth="498.0000999999975" xmlns:fx="http://javafx.com/fxml">
  <children>
    <HBox prefHeight="39.5" prefWidth="496.0" spacing="5.0" style="-fx-background-color: cornsilk" StackPane.alignment="CENTER_RIGHT">
      <children>
        <Label minWidth="-Infinity" style="-fx-background-color: slategrey" text="Important Label" HBox.hgrow="SOMETIMES" />
        <Label style="-fx-background-color: lightgrey" text="Vastly less Important Label" HBox.hgrow="NEVER" />
        <Label alignment="CENTER_RIGHT" maxWidth="1.7976931348623157E308" minWidth="-Infinity" style="-fx-background-color: palegreen" text="Important Label" HBox.hgrow="ALWAYS" />
      </children>
      <padding>
        <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
      </padding>
    </HBox>
  </children>
</StackPane>It's probably not exactly what you want, but hopefully it is helpful.
Oddly, in my tests, the HBox.hgrow SOMETIMES priority doesn't seem to have any preference over the NEVER priority. So when you resize the thing smaller, the first two labels start to get elided unless you start to specify minWidth values.
So I set the minWidth of the first label to the preferred width (and same for the last label). That causes the two important labels to never get elided (which might be the behaviour you want for the important labels anyway).
Setting the alignment of the HBox itself to CENTER_RIGHT means (in combination with the right most label's HBox.hgrow of ALWAYS and a minWidth of the preferred width) that the rightmost important label is always visible and the other labels get pushed off to the left hand side if there is not enough room.
Setting the maxWidth of the rightmost label to MAX_VALUE and it's alignment to CENTER_RIGHT right aligns the label in the HBox.
The styles are just in there so that it is easy to see how big each label is - normally you would stick that kind of stuff in a stylesheet.
The values of things like minWidth="-Infinity" and maxWidth="1.7976931348623157E308" are weird constants because that is what SceneBuilder outputs rather than something sensical like Label.USE_PREF_SIZE or Double.MAX_VALUE
And yeah, as you point out in your question "USE_COMPUTED_SIZE (-1.0) is actually the default minwidth", so there is no point in explicitly setting minWidth to that value.

Similar Messages

  • [svn:fx-trunk] 7079: -Move init of heightInLines out to skin.

    Revision: 7079
    Author:   [email protected]
    Date:     2009-05-19 10:43:53 -0700 (Tue, 19 May 2009)
    Log Message:
    -Move init of heightInLines out to skin.
    -Handle constrained width in RichEditableText for both the autoSize and !autoSize case.
    -For autoSize, width/height/minWidth/minHeight are ignored.  If lineBreak="toFit", maxWidth determines where wrap will occur (unless it is constrained in which case that width trumps).  The default maxWidth, if not specified is 160.  If lineBreak="explicit" the text determines the width.  When autoSizing, height is not bounded and there is no scrolling.
    QA Notes:
    Doc Notes:
    Bugs: SDK-21115, SDK-20400, SDK-21125
    Reviewers: Gordon
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21115
        http://bugs.adobe.com/jira/browse/SDK-20400
        http://bugs.adobe.com/jira/browse/SDK-21125
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextInput.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/TextAreaSkin.mxml
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/TextInputSkin.mxml

    technic wrote:It would be great to have own fork of PKGBUILD tree and easily merge it with upstream. When there is update available rebuild only packages that differs. Could you please tell me if similar tool already exists ?
    This doesn't do that and AFAIK it would require a huge rewrite/change. I'm also not aware of anything that does that. I'll look into it.
    technic wrote:Maybe you have updates of this bash script ?
    I have some updates, the last one was on August 12th.
    I've been using it pretty much every day since I posted here and I quite like it.
    Allan wrote:That should be fine.
    Thanks.
    Do you think the idea is valid?

  • MinHeight/MinWidth is ignored

    After setting the MinHeight value of a AnchorPane with SceneBuilder (writes correctly to fxml file) the window is still resizable into a size with a smaller height.
    From Java this.rootPane.getMinHeight() does return the right value.
    Example FXML:
    <minHeight>
    <Long fx:value="400" />
    </minHeight>
    Using JavaFX 2.2 (JDK7u7)

    I didn't get why there are these "minimum" properties? Where do they occur?The minHeight/minWidth properties on Region are enforced in Layout Panes.
    http://docs.oracle.com/javafx/2/api/javafx/scene/layout/Region.html#minHeightProperty
    For the root pane root pane it can seem that the minimum size properties have no effect because the root scene will be clipped to the available area as the stage is sized small so, in effect part of the control does not lie within the visible window (unless you also set a minimum size for the stage as Daniel mentions).
    To see suggestions on how the property may be used, search for minHeight in the following tips document:
    http://docs.oracle.com/javafx/2/layout/size_align.htm
    Usually you use the properties to enforce a minimum or maximum size of resizable nodes placed in a layout manger that are being laid out relative to each other. You can think of the preferred size as the default size of a node and the node can stretch in size like a rubber band between it's minimum and maximum sizes. Note that there are a few tricks in the layout managers where you can set static constraints for sizing using things like HBox.setHGrow(node, Priority.NEVER). Additionally, some things like buttons by default have there max sizes clamped to their preferred size.

  • Animated GIF ignoring frame timing

    I am trying to create simple animated GIFs with a few layers
    of text that simply fade in and fade out in sequence. My initial
    attempt worked perfectly. Most frames use the default 7/100's of a
    second delay as they fade. A few frames were manually set to much
    longer delays so that the text pauses, before fading out to be
    replaced by the next text.
    When I reopened the file, to adjust the background color, and
    then re-saved it, the GIF now plays straight through, ignoring the
    timing of each frame. Nothing I do now can get it to pause on the
    appropriate frames. I've tried cutting the symbols out and pasting
    them into a new file, removing the animation from the symbols and
    reapplying it, etc.
    Any ideas, anyone?
    Thanks in advance.

    None, None.

  • How do i use one midi controller and ignore another in Mainstage 2.1?

    I am running Mainstage and Ableton Live in parallel and use two midi controllers. I would like the APC40 to just be recognized by Live, and my MPK49 to be recognized by Mainstage and Live. Right now, I get midi signal from Mainstage on both midi controllers and can't seem to figure out how to assign just Mainstage to just get midi input from the MPK49. Any ideas? Thanks.

    Yes, that worked a the device popups were set to all. Fixed that and moved on. Thanks! However another similar problem has come up...
    The sliders on the APC40 (which I just want to be recognized by Live), are affecting the Mainstage Channel Strips volume sliders. I can't seem to figure how to make Mainstage ignore this as all of the APC40 sliders are effecting Channel Strip 1. Thanks.

  • How to get Materialized View to ignore unused columns in source table

    When updating a column in a source table, records are generated in the corresponding materialized view log table. This happens even if the column being updated is not used in any MV that references the source table. That could be OK, so long as those updates are ignored. However they are not ignored, so when the MV is fast refreshed, I find it can take over a minute, even though no changes are required or made. Is there some way of configuring the materialized view log such that the materialized view refresh ignores these updates ?
    So for examle if I have table TEST:
    CREATE table test (
    d_id NUMBER(10) PRIMARY KEY,
    d_name VARCHAR2(100),
    d_desc VARCHAR2(256)
    This has an MV log MLOG$_TEST:
    CREATE MATERIALIZED VIEW LOG ON TEST with rowid, sequence, primary key;
    CREATE MATERIALIZED VIEW test_mv
    refresh fast on demand
    as
    select d_id, d_name
    from test;
    INSERT 200,000 records
    exec dbms_mview.refresh('TEST_MV','f');
    update test set d_desc = upper(d_desc) ;
    exec dbms_mview.refresh('TEST_MV','f'); -- This takes 37 seconds, yet no changes are required.
    Oracle 10g/11g

    I would love to hear a positive answer to this question - I have the exact same issue :-)
    In the "old" days (version 8 I think it was) populating the materialized view logs was done by Oracle auto-creating triggers on the base table. A "trick" could then make that trigger become "FOR UPDATE OF <used_column_list>". Now-a-days it has been internalized so such "triggers" are not visible and modifiable by us mere mortals.
    I have not found a way to explicitly tell Oracle "only populate MV log for updates of these columns." I think the underlying reason is that the MV log potentially could be used for several different materialized views at possibly several different target databases. So to be safe that the MV log can be used for any MV created in the future - Oracle always populates MV log at any update (I think.)
    One way around the problem is to migrate to STREAMS replication rather than materialized views - but it seems to me like swatting a fly with a bowling ball...
    One thing to be aware of: Once the MV log has been "bloated" with a lot of unneccessary logging, you may perhaps see that all your FAST REFRESHes afterwards becomes slow - even after the one that checked all the 200000 unneccessary updates. We have seen that it can happen that Oracle decides on full table scanning the MV log when it does a fast refresh - which usually makes sense. But after a "bloat" has happened, the high water mark of the MV log is now unnaturally high, which can make the full table scan slow by scanning a lot of empty blocks.
    We have a nightly job that checks each MV log if it is empty. If it is empty, it locks the MV log and locks the base table, checks for emptiness again, and truncates the MV log if it is still empty, before finally unlocking the tables. That way if an update during the day has happened to bloat the MV log, all the empty space in the MV log will be reclaimed at night.
    But I hope someone can answer both you and me with a better solution ;-)

  • Apple Support ignores me completely, there is no way I can complain about lack of feed back and I even have paid for a protection plan!

    I have paid for an extended support through the Apple protection plan. Frankly I do not understand what I´ve paid for as there is no support and no plan, except ignorance and waiting time.
    I have had and still have serious problem with my Mac Book Pro, and spent loads of money on phone charges with mainly negative results. All I have "achieved" is wasted time. I just wonder if it is only me who feel totally helpless as the Support People are not really helping. I´ve spent approsmimately 200 USD in phonecharges on their support phone, so far. But that is nothing compared to the hours spent waiting for answer and listening no absolute nonsense. Finally I went to an Apple store who sent the machine in for repair, and one fault was the motherboard. However I could still not connect with my Time Capsule and Aperture seemed to have lost all my photos. This all happende after upgrading to Mountail Lion. Also the cable network isn´t working. I can easily see on the net that I am not the only one with problems. I´ve ended up with solving most of this myself, except the network connection. It is still not working.
    I am actually deeply dissapointed with Apple and I cannot find any way to even forward a complaint. Not that I believe it would help, but at least I´ve tried. I also think it would be fair to to get my money back for a product I´ve paid for which obviously isn´t working, namely the Apple Care Protection Plan.

    Hi, so you suggest I should be grateful for getting what I have paid for? Sorry but that's only getting what I paid for. Add to that, that this has been against the phone support I've used a lot of time and money for! I don't feel anything but hopelessness for the total lack of customer support. An expensive Mac Book Pro shouldn't fail after 2 years in the first place! But failure may of course happen with the best products, and Apple as well. The real fault however is Apple's arrogance and failure to fix it! Instead of getting help and guidance to a solution, I used hours and lost days of work, and was made to pay a lot for total unusable "assistance". I was even adviced to hold back on taking the Mac Book Pro to a store, as I was told the support person a senior, would figure it out. Well Apple definiately squezzed the lemon! Since the Time Capsule/Time Machine system didn't fuction I was also in a stale mate as I needed assurance that My files wasn't lost when delivering the machine for repair. I was adviced that could happen. Quite a deadlock wasn't it! As an expert on Quality Assurance I was also suffering lost revenue in my work for clients. I finally had to buy a Samsung Ultrabook as working machine and backup, a neccesity as Apple obviously cannot be trusted when needed. Bill Gates and Windows has one advantage over Apple, they know things can go wrong and hence have much better support. Apple support is a maze were only the strongest and most persistent get through. I am one as I didn't accept being treated like that. That's the only reason I finally got a repair. However the machine is still not functioning as mentioned. I have a case number, a phone number and mail address to a senior support person, whom I've been trying to contact for more than a week, He has still not responded to my mails or phone calls. I cannot even figure out how to contact Apple to complain about such ignorance. Note by the way that here in Norway I must pay to call support and more often than not there is more than half an hour waiting time. I might spend hundred of dollars in that "game" without even knowing that I will get the support I've paid for and only keep paying even more for wasting my time! This is simply not good enough, it is no less than arrogant and wrong! I frankly think Apple is doing a big mistake with such por treatmen of their customers.

  • Incompetent CS ignores you, lock your call/case or sends defective parts : What should i do?!

    Hello. I live in France and the Lenovo CS (same line for all europe i guess) has always been poor in terms of communication (title says incompetent but autistic would be a better word for the case..). Apparently i'm far from being the only one feeling so, but now it reached another level :
    Since the begining i had my Thinkpad, it had many strange powering related issues, many. They often told me i could have the motherboard replaced, but i refused cause i didn't felt safe with it. Now that warranty was coming to an end, i thought about it and was like "come on, let's go for it" even though i still didn't felt safe about it..
    I also had trouble with the fan making strange noise at times. They actually sent a fan to me a year ago but it wasn't the right FRU, i just let go on that at this time. Now, since i was going to get the motherboard replaced (they agreed) i told them to please send back the fan, reminding them it was supposed to be changed.
    As said i do not feel safe when someone has to tear appart my unit, i'd rather do it myself. So i said, please change the parts all at once. That's when it got complicated. They refused to change the fan. Even though i sent them back their automatic mail showing that part was sent back in time (that's what they asked). From there it was just hell :
    [Just so you know, i have Day+1 on site warranty] Not only they ignored mails but also tried shortening the call, telling me to "keep calm and wait" in a very rude way. From there, since emails were ignored, i called back from time to time, only to get repeated "WAIT" with no communication possible and calls most often hanging in the end.
    The last person i had, being nicer, told me they had a problem in their system and couldn't communicate with the tech guys. But her speech became unclear and it appeared clearly it was bull**bleep**. She also surprisingly told me the fan was now included in the repair..!
    At that point it's been more than a week of waiting, i asked around if somebody by chance would have an IBM tech phone number (since they're the people doing the repair). Someone kindly sent me one and it worked. I called him next day and he answered.
    Talking to the IBM tech, he first told me they had absolutely no communication issue and after looking at my case/call, immediatly mentionned it was locked. He wrote something to IBM and told me to call him back the next day. So i did and since nothing changed, he kindly did what the CS is supposed to do, he set and appointment.
    A tech came next day (that's what Day+1 is supposed to be). Guess what? They sent wrong fan again. Hard to believe it's a mistake again. Anyways, the motherboard replacement took place without much trouble. I then waited for the tech to come back with the fan. But the CS is still being what it is :
    Just before the tech came for the MB replacement, i called CS just to make sure they know what's going on. The lady said "great, hope all works for you after!" so i thought hell's over. But after the tech did his work and left, having a little issue (now resolved) i called back CS and this time the lady was again like "WAIT" she didn't even know the tech came!
    You never know when if they're lying. But i guess they do a lot. After the MB was replaced, i noticed trackpad/touchpad had issues. But that quickly came back. I also noticed the GPU was overheating (temps were already high before). The new fan was making more annoying noise. I just asked them to change it. But no, their super IT decided to change the CPU..
    I told them over and over it was the GPU overheating, not CPU. But they insisted; Tech came with new CPU which WASN'T brand new (it's supposed to be). It was refurbished.. Wait, it said "certified reutilized" no idea what that means..? Unfortunatly the issue with ultranav came back and this time stayed dead, the fingerprint was also dead. So the tech came back.. Whilh testing, he did reset the bios, which sets graphics to optimus. I always use discrete only.
    That's when we discovered a new issue : the integrated graphic is totally defective, screen flash on/off every 5sec or so and then system freeze..! So in the end, ALL parts they replaced were having much worse trouble then original one! And replacing the CPU for a defective one may be intentional.. Since the warranty end, they may think i'll buy a new one after this one dies.. Sorry but you're wrong!
    What the hell Lenovo, you can't even communicate with your collegues..? It's shocking when the IBM tech talk to them, it's like they don't believe what he says. Or don't understand.. Since their level is SO LOW. My warranty now got only 10 days remaining.
    I don't know if/when they're going to decide to do something. They now regularly ask me to send back the whole unit to them. No way, i won't do that. Thinkpads are great but warranty is crap, be careful when buying expensive on site extensions.
    As you know, parts are guaranteed 3 months after they get changed, even your warranty ends before. But seeing how they act, I'm now very worried, it seems i can only rely to the IBM tech, which unfortunatly have no power/rights here.
    I know there are some Lenovo staff here, hope they'd say a word. Even though i'm in Europe, this is global lenovo forum... There is apparently NOT A SINGLE WAY to complain to a higher level in this company.

    Julien,
    Thanks - we have escalated your case to our regional customer relations team and I have confidence that they will be able to help you bring this regrettable saga to a positive resolution.
    I understand your concern on the timing of this.
    Best regards, 
    Mark
    ThinkPads: S30, T43, X60t, X1, W700ds, IdeaPad Y710, IdeaCentre: A300, IdeaPad K1
    Mark Hopkins
    Program Manager, Lenovo Social Media (Services)
    twitter @lenovoforums
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • Absolute WORST customer support - lied to and ignored

    I have never received worse customer support from a company.
    About a month ago I downloaded the trial for Adobe Media Server 5 as we had been running FCS 1.5 for a long time and decided it was time to update.
    The trial worked well for my custom application, and I was contacted by an Adobe Sales Rep during the trial period.
    I chatted with her on the phone and she assured me that the ONLY difference between AMS 5 Standard and AMS 5 Professional (besided an additional $1000 price tag) was that AMS 5 Professional had IP multicasting, which is functionality we did not need (this was misinformation #1). She assured me there would be educational pricing (as I work at a University).
    I received a link to the regular store, and when I inquired about it I was told there was no education pricing for AMS 5 (misinformation #2).
    So based on the advice of the representative, we purchased the standard edition - purchasing here takes multiple signatures and a few weeks of time. When we finally got AMS 5 standard, I installed it and.. lo and behold my application did not work - but it worked when I removed the serial # from the server. After a ridiculous amount of digging and reading the logs, I found that AMS standard does not support custom applications. I had been misinformed by the sales representative.
    I then contacted support - that took about 1.5 hours for them to get back to me, and then when I picked up the phone (using the callback service) it took another 10 minutes for someone to pick up! I had to give my information 3 separate times to 3 separate staff before I was transferred to the proper department. I spoke to someone on the AMS sales team and told them I had been misinformed by a representative about my purchase, and now I will not be able to make my deadline so I was hoping there was some way this could be fixed. They asked for the name of the representative and mentioned they would speak to them and and get back to me.
    The original sales representative got back to me and I spoke with her and she insisted that I was incorrect and that she specifically mentioned custom apps. I said that was not the case and if possible, could we review the phone call recording for accuracy? She said that would take some time. I said considering this was Adobe's mistake, would it be possible to upgrade my version? She said they do not do that anymore and that the best they could do was a refund. I explained that my deadline was looming and that I would not be able to purchase a new verison in time. She said there was nothing she could do, so I asked to speak to the manager. The manager e-mailed my asking for my phone number, and then never called me. So 2 hours later I sent the following e-mail:
    Hi [Manager],
    I am still anticipating your call today before 4:00 pm PST. I had asked that my original phone conversation recording be reviewed for accuracy. The resolution of this issue is time sensitive so please call as soon as possible.
    Cheers,
    [Me]
    and I received this in response.
    Hi [Me],
    My calendar is tied up today. I will call you first thing tomorrow morning.
    Also wanted to let you know that we do not record calls.
    Thanks,
    [Manager]
    Okay, a call centre that doesn't record calls - really? That's 3 pieces of conflicting information now. Then (admittedly) I got a bit angry:
    I keep getting different information from each person and it has wasted a significant amount of my time. On the phone I was told we could review the recording of the call, now I am told that you don't record the calls. I was told there was educational pricing, then I find there is not educational pricing. I was told that the only difference between the versions was IP multicasting which led me to purchase the standard version, then I had to find out on my own that that was not the case. I would like Adobe to take responsibility for their mistakes and misinformation. I would like an upgrade to the professional version. If you are not authorized to do that, please put me in contact with someone who can.
    And guess what? Nothing. So I sent another e-mail.
    Hi [Manager],
    Is there any reason why I have not gotten a phone call or e-mail response?
    Thanks,
    [Me]
    I got this back:
    I just called and left you a VM.
    Will try to connect with you later today.
    Thanks,
    [Manager]
    And I haven't heard from them since. The deadline was today, now I have no server, no running application, and am totally hooped. We have PO in for the pro version, but that won't be processed for probably another week. I have mailed the manager back and the sales rep letting them know I'll be following up on the issue, but I doubt I will get any repsonse from them either and I have no clue where to even direct my inquiry...
    So, thanks Adobe, for providing the wrong purchasing advice, blaming it on me, giving me the runaround and ignoring me. I guess companies no longer really care about their customers, just the bottom line.

    Well, it's now end-of-day on the 10th.
    After sending e-mails to the 2 parties above telling them I would be following up, I got a follow up late last Friday with someone who claimed to be getting a temporary serial key, only then to tell me afterwards that it was not possible.
    Monday, my support ticket was closed with no explanation. I reopened it.
    I have had someone PM me on the forums yesterday, telling me a senior agent would contact me. They haven't.
    So, the nightmare continues I suppose. I'll keep updating this until it gets resolved.

  • TableFileterDemo - ignore case

    I have implemented the code from the java tutorials "TableFilterDemo" into some of my code and have it working. I was trying to tweak it a bit to have it ignore the case when you enter text to filter for. I took a look at the String class and the equalsIgnoreCase but I'm not comparing it in this case. I also went the route of pattern:
    final int flags = Pattern.CANON_EQ | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE;
    pattern = Pattern.compile(filterText, flags);but that broke it where it would not filter anything. Any ideas on what I might be missing?
    package tablefilter;
    * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *   - Redistributions of source code must retain the above copyright
    *     notice, this list of conditions and the following disclaimer.
    *   - Redistributions in binary form must reproduce the above copyright
    *     notice, this list of conditions and the following disclaimer in the
    *     documentation and/or other materials provided with the distribution.
    *   - Neither the name of Oracle or the names of its
    *     contributors may be used to endorse or promote products derived
    *     from this software without specific prior written permission.
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * TableFilterDemo.java requires SpringUtilities.java
    import javax.swing.*;
    public class TableFilterDemo extends JPanel {
        private boolean DEBUG = false;
        private JTable table;
        private JTextField filterText;
        private JTextField statusText;
        private TableRowSorter<MyTableModel> sorter;
        public TableFilterDemo() {
            super();
            setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
            //Create a table with a sorter.
            MyTableModel model = new MyTableModel();
            sorter = new TableRowSorter<MyTableModel>(model);
            table = new JTable(model);
            table.setRowSorter(sorter);
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            table.setFillsViewportHeight(true);
            //For the purposes of this example, better to have a single
            //selection.
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            //When selection changes, provide user with row numbers for
            //both view and model.
            table.getSelectionModel().addListSelectionListener(
                    new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent event) {
                            int viewRow = table.getSelectedRow();
                            if (viewRow < 0) {
                                //Selection got filtered away.
                                statusText.setText("");
                            } else {
                                int modelRow =
                                    table.convertRowIndexToModel(viewRow);
                                statusText.setText(
                                    String.format("Selected Row in view: %d. " +
                                        "Selected Row in model: %d.",
                                        viewRow, modelRow));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this panel.
            add(scrollPane);
            //Create a separate form for filterText and statusText
            JPanel form = new JPanel(new SpringLayout());
            JLabel l1 = new JLabel("Filter Text:", SwingConstants.TRAILING);
            form.add(l1);
            filterText = new JTextField();
            //Whenever filterText changes, invoke newFilter.
            filterText.getDocument().addDocumentListener(
                    new DocumentListener() {
                        public void changedUpdate(DocumentEvent e) {
                            newFilter();
                        public void insertUpdate(DocumentEvent e) {
                            newFilter();
                        public void removeUpdate(DocumentEvent e) {
                            newFilter();
            l1.setLabelFor(filterText);
            form.add(filterText);
            JLabel l2 = new JLabel("Status:", SwingConstants.TRAILING);
            form.add(l2);
            statusText = new JTextField();
            l2.setLabelFor(statusText);
            form.add(statusText);
            SpringUtilities.makeCompactGrid(form, 2, 2, 6, 6, 6, 6);
            add(form);
         * Update the row filter regular expression from the expression in
         * the text box.
        private void newFilter() {
            RowFilter<MyTableModel, Object> rf = null;
            //If current expression doesn't parse, don't update.
            try {
                rf = RowFilter.regexFilter(filterText.getText(), 0);
            } catch (java.util.regex.PatternSyntaxException e) {
                return;
            sorter.setRowFilter(rf);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                                            "Last Name",
                                            "Sport",
                                            "# of Years",
                                            "Vegetarian"};
            private Object[][] data = {
             {"Kathy", "Smith",
              "Snowboarding", new Integer(5), new Boolean(false)},
             {"John", "Doe",
              "Rowing", new Integer(3), new Boolean(true)},
             {"Sue", "Black",
              "Knitting", new Integer(2), new Boolean(false)},
             {"Jane", "White",
              "Speed reading", new Integer(20), new Boolean(true)},
             {"Joe", "Brown",
              "Pool", new Integer(10), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                return getValueAt(0, c).getClass();
             * Don't need to implement this method unless your table's
             * editable.
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
             * Don't need to implement this method unless your table's
             * data can change.
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                data[row][col] = value;
                fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("TableFilterDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TableFilterDemo newContentPane = new TableFilterDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    sorter.setRowFilter(RowFilter.regexFilter("(?i)" + text));, works for ASCII, but doesn't works correctly for Latin1-X and another Charsets for some chars near to EnterKey (on the keaboard)
    please for Swing rellated question is there Swing

  • How to ignore blank/null key figure value in BI Queries

    Reports on Multiprovider - we see some cells of a Key figure as blanks. These blanks are interpreted as zeros by the system and calculated accordingly resulting in incorrect values. As per our requirement, we need a count of all hard/real zeros only, not the blanks. For example, if there are 10 rows of which 6 are real zeros and 4 are blanks - our count should be 6 and not 10.
    How to ignore the blanks in BEx queries please?
    Thanks for your help.
    Upender

    Rakesh,
    It is not possible to find a pattern because the report is on a MultiProvider with 2 InfoProviders- Purchasing documents DSO and Material Movements InfoCube.
    Every Purchasing Document has several materials associated with it. These materials are compared with materials in Materials Movement. Not all materials in Purchasing Document are found in Materials Movement. For those Materials found in Materials Movement, the Quantity is obtained. For these found rows, the correct value is showing up - if the quantity is zero, it is showing in reports as zero. If the material is not found in Material Movements then Quantity shows up as blank values.
    My requirement is ignore such blank quantities and not count them. Only Quantities with 0 values should be counted. Currently both blanks and zero values are counted showing inflated count.
    Thanks,
    Upender

  • Upload to Google Drive ignores my "Do not OCR" setting

    I love the HP AiO app on my iPhone. I use it to scan all my snailmail, which helps a lot with my personal administration.
    However, when I scan a document to PDF and then upload that PDF to Google Drive, I get a file with a .pdf.gdoc extension, which attempts to OCR my document. While this can be useful, there are also documents like a diploma, passport etc that I want to keep as PDF files. My Google Drive settings are configured to not perform any OCR nor to try to convert a PDF to a Google Doc. But it looks like the app ignores these settings. Would it be possible to fix this?

    Hi zeptimius, welcome to the HP Forums. I understand when you scan PDF files, and save them to Google Drive it is being OCR'd regardless of your setting on Google Drive to not OCR.
    I am not certain how Google processes these documents, but I suggest you scan somewhere else to see if it ends up being OCR'd. This will tell you if the OCR option is being done before getting to Google Drive. If it does not, then you would have to contact Google to ask how to prevent this undesirable action.
    Let me know what you come up with.
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Status keeps changing from invisible to online: why the issue is ignored?

    There is a serious issue raised in the parallel thread, which is critical for many people: "Status keeps changing from invisible to online" (initiated on ‎16-11-2014 by b.agne, Mac section). In short, when starting using a device, the Skype status changing from "invisible" to "online" - sometimes just for a moment, though enough for others to notice you. These affects very much any type of devices. I am sure the issue has already led to multiple personal crisises and potentially financial losses due to buseness partnership issues (I came close to that myself, and now use anything but Skype for business). The question is: WHY the issue is completely ignored by Skype, Microsoft and expert comunity? Please post the solution if anybody knows how to fix the issue, or suggest how to make Microsoft to know that it should be fixed. Kind regard...

    Hi, I also have the same issue. I change the status to Invisible and a later on it is already as "Online", without having even touched/opened Skype. The only way that I see this may happen is that I have the app installed on the smartphone, but before it never had this issue, but from some month ago it started. Any correction or suggestion to work around this issue? Regards

  • I can't get video to loop exporting an OAM file and importing into Muse. Seems to ignore all triggers.

    I've tried everything I can think of, but triggers are ignored. I've tested in Safari and Firefox so far. Tested in Muse Preview. Tested in An. Nothing is paying attention to the trigger I have set up.
    I've used a label to get it to loop back to the beginning. I've used zero to get it to loop back. I've searched the web, YouTube, and here looking for answer none will fix this. No errors in the error box BTW. Been back to Lynda.com re-re-viewing videos. All seems fine, but it isn't.
    Website is here: http://www.moviesandfx.com. The animation on the home page is what I want to loop. It plays okay in Safari, has mixed results in Firefox. Not sure yet about IE, I'm on a Mac.
    I'd love to hear ideas to fix this. The workflow is An—>OAM export—>Muse "place"—>Muse publish to ftp.
    Thank you,
    Dan

    I'm having the same problem. I inserted the oam in Dreamweaver, where it loops forever in split and live view. As soon as I view it in a browser (Safari and Chrome), the looping is disabled. There are no console errors.

  • I changed my password and it updated on all of my devices except my ipad... Now I get this error message from icloud saying icloud backup cannot access my account... There are two options: ignore or settings

    Error message: icloud unable to access my account... I changed my password, this is the message on my ipad. gives me two options: ignore/settings... ipad not responding to either... ?

    Try a soft-reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider if it appears), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

Maybe you are looking for

  • Activation of transformation in BI 7.0

    Hi to all, I have to activate transformation in production environment , Kindly let me know any Function module or prog. name to activate the same. I am working in BI 7.0. Thanks Shalini

  • Weblogic-cmp-jar.xml and EJB 1.1

    I am working on migrating a number of components from JBoss to WebLogic 10. Some of these components are using EJB 1.1. I want to do the migration without having to updated to EJB 2.0 or EJB 3.0. I have looked at the documentation for WebLogic 10 and

  • Oracle VM Migrating virtual disk images to physical disks (block devices)

    Hi, For performance reasons, I'd like to migrate my .img file based virtual disks into physical partitions for VM's. What is the safest possible way to migrate all partitions (including / partition) from a virtual disk to a block device? Thanks, Onur

  • My apple tv doesn't connect automatically to iTunes unless i turn on iTunes on computer

    Hello I have two apple tv's 3rd gen. the problem i am having is any time i want to access my movie library it tells me to turn on home sharing in which i already have home sharing turned on. I have noticed for me to access my movies i have to go upst

  • I can't move the position of my nautilus windows

    sorryy for this newbie question,but i wanna ask how i can move my windows to see the wobbly windows effect? i have enable it at compiz seeting manager and still i cant move my windows.thank u