Custom DefaultTreeCellRender not rending node labels correctly.

In our JTree we need to display the state of our custom nodes, the state can be cycled by the user clicking on the node. Our problem is that since upgrading from Java 1.4 if a node is clicked before it is expanded the child nodes will not be rendered correclty, some nodes may not have the label showing, some may not have the label or icon showing.
Under Java 1.4 the following code works correctly.
Under Java 1.5 and 1.6 If you click on a node before expanding it (which changes the node's icon) then expand the node the child nodes are not completely rendered, some may be missing a icon or label or both.
package com.test;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.Box;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
* Example to demonstate differences between Java 1.4 and Java 1.5/1.6
* node rendering.
* <p>
* Under Java 1.4 nodes are always rendered correctly.
* <p>
* Under Java 1.5 and 1.6 If you click on a node before expanding it (which
* results in the icon changing) then expand the node not all child nodes
* will be fully rendered.
public class TreeNodeRenderExample extends javax.swing.JFrame {
    private static final long serialVersionUID = 7963956320358601702L;
    private JTree tree1;
     * Entry point.
     * @param args Arguments are ignored.
    public static void main(String[] args) {
        TreeNodeRenderExample inst = new TreeNodeRenderExample();
        inst.setVisible(true);
     * Constructor.
     * <br>
     * Create a instance of TreeNodeRenderExample.
    public TreeNodeRenderExample() {
        super();
        initGUI();
        populateTree();
        postInitGUI();
     * Create the Frame and JTree.
    private void initGUI() {
        try {
                this.setTitle("Checkbox node Render Example");
                tree1 = new JTree();
                getContentPane().add(tree1, BorderLayout.CENTER);
            setSize(400, 300);
        } catch (Exception e) {
            e.printStackTrace();
     * Add the custom cell renderer and a mouse listener.
    private void postInitGUI() {
        tree1.setCellRenderer(new NodeRenderer());
        tree1.addMouseListener(new TreeMouseClickSelectionListener(tree1));
     * Populate the tree.
    private void populateTree() {
        TreeNode root = new TreeNode("Render Example");
        TreeNode colourNode = new TreeNode("Colours");
        TreeNode modelNode = new TreeNode("Models");
        colourNode.add(new TreeNode("Black"));
        colourNode.add(new TreeNode("White"));
        colourNode.add(new TreeNode("Blue"));
        modelNode.add(new TreeNode("Ford"));
        modelNode.add(new TreeNode("Fiat"));
        modelNode.add(new TreeNode("Nissan"));
        root.add(modelNode);
        root.add(colourNode);
        tree1.setModel(new DefaultTreeModel(root));
     * Custom tree node to allow the icon to be changed when the node
     * is clicked.
     * <p>
     * This is a simple example, our custom nodes hold much more state
     * information and get node children on the fly.
    class TreeNode extends DefaultMutableTreeNode {
        private static final long serialVersionUID = 7527381850185157388L;
         * Constructor.
         * <br>
         * Create a instance of TreeNode.
         * @param name Tree node display name.
        public TreeNode(String name) {
            this.name = name;
            this.state = "u";
         * Just cycle through some states so that the icon can
         * can be changed depending on how may 'clicks' on the node.
        public void updateSelectionStatus() {
            if (state.equals("u")) {
                state = "s";
            } else if (state.equals("s")) {
                state = "d";
            } else if (state.equals("d")) {
                state = "u";
         * Get the icon to be used for the check box, shows the current
         * state of a node to the user.
         * @return A icon.
        public Icon getIcon() {
            Icon icon = null;
            if (state.equals("u")) {
                icon = UIManager.getIcon("FileView.directoryIcon");
            } else if (state.equals("s")) {
                icon = UIManager.getIcon("FileView.fileIcon");
            } else if (state.equals("d")) {
                icon = UIManager.getIcon("FileView.computerIcon");
            return icon;
         * String representation of a node.
         * @see javax.swing.tree.DefaultMutableTreeNode#toString()
        public String toString() {
            return name;
        private String name;
        private String state;
     * Custom node render, adds a checkbox in front of the node, could be
     * any object that we can change the icon for, this will show the
     * user the current state of the selected node.
    class NodeRenderer extends DefaultTreeCellRenderer {
        private static final long serialVersionUID = -7358496302112018405L;
        protected JCheckBox checkBox = new JCheckBox();
        //protected JButton checkBox = new JButton();
        private Component strut = Box.createHorizontalStrut(5);
        private JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER,0,0));
         * Constructor.
        public NodeRenderer() {
            setOpaque(false);
            this.checkBox.setOpaque(false);
            this.panel.setBackground(UIManager.getColor("Tree.textBackground"));
            this.panel.setOpaque(false);
            this.panel.add(this.checkBox);
            this.panel.add(this.strut);
            this.panel.add(this);
         * Render the label, then change the icon if necessary.
         * @see javax.swing.tree.DefaultTreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean)
        public Component getTreeCellRendererComponent(JTree tree, Object value,
            boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
            super.getTreeCellRendererComponent(tree, value,
                sel, expanded, leaf, row, hasFocus);
            updateDisplayedStatus((TreeNode)value);
            return this.panel;
         * Set the node's icon.
         * @param node Rendered node.
        private void updateDisplayedStatus(TreeNode node) {
            this.checkBox.setIcon(node.getIcon());
     * Listener to allow cycling of node states by clicking on the node.
    class TreeMouseClickSelectionListener extends MouseAdapter {
        private JTree tree;
        private int hotspot = new JCheckBox().getPreferredSize().width;
         * Constructor.
         * <br>
         * Create a instance of TreeMouseClickSelectionListener.
         * @param tree Tree listener is attached to.
        public TreeMouseClickSelectionListener(JTree tree) {
            this.tree = tree;
         * Cycle the state of a clicked node.
         * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
        public void mouseClicked(MouseEvent me) {
            int x = me.getX();
            int y = me.getY();
            int row = tree.getRowForLocation(x, y);
            TreePath path = tree.getPathForRow(row);
            if (path != null)
                if(x <= tree.getPathBounds(path).x + hotspot)
                    TreeNode node = (TreeNode) path
                        .getLastPathComponent();
                    if (node != null)
                        node.updateSelectionStatus();
                        tree.repaint();
}

I can't recreate your problem. I'm running 1.5.0_09. When I open the program and JUST expand the nodes I see all "file" icons and all the labels work correctly. If i Select a node before expanding it, I get the same result.
What Am I supposed to witness happening?
-Js

Similar Messages

  • Why does f12(preview in browser mode) not render the page correctly?

    Why does f12(preview in browser mode) not render the page correctly? Instead when i go to the main or original file, it renders properly? It is drriving me nuts! HAHA! Can anyone help? mainly CSS problem, div overlapping but when viewing from original file on browser not through F12, it renders correctly. CS5.5 DW. Thanks!

    just that one of it is a f12 (preview in browser) while the other one is going to the directory and clicking the html page by itself.
    F12 is simply a hot key that launches your browser.
    The only thing I can think of to explain this is that you have a local site folder someplace in addition to a testing server site.
    When you hit preview, your testing server on the localhost/ is being called up in the browser.
    When you open the HTML page directly, you're seeing the local site file with unparsed data.
    Try disabling your Testing Server in Sites > Manage sites > Edit...
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com/

  • CR XI R 2 and CR 2008 does not render Khmer Unicode correctly

    Post Author: khmerangkor
    CA Forum: General
    Having evaluate CR XI R 2 and CR 2008 in Visual Studio 2005 and Visual Studio 2008.  The result:When I work with Crystal
    Report Application itself is fully supporting the Khmer Unicode. Then
    I include it into VS 2005 and 2008, it does not support Khmer Unicode at all.  Basically, it does not render at all. Hope Crystal Report Development Team look into this problem and help us to develop report in Khmer Unicode.  We belive in your product.Regards,Khmer

    Don,
    the problem seem to be that Version XI Rel 2 is not only an Upgrade of Version XI (for what I just purchased a license) but a special Version.
    So I have the Trial Version XI Rel 2 and my Reg. Key does not comply with it.
    I Think SAP ony gives the user the right to use Version XI Rel 2 I you buy a full Version (even if you are Crystal reports Customer for 15 years).
    Very diffuse and time wasting the whole thing. I hope my old projects still using Crystal reports will soon run out of use.
    Cheers for your efforts
    Miko

  • Why Does DW Not Render My Page Correctly and Chrome Does ?

    Hi - I'm developing a site for WordPress. The site body has a background-image which gives a progressive soft grey to the page. If I display it in Chrome the background image renders perfectly well, but inside DW it is missing entirely. Doubly strange is that there is also another image around the #container and this renders perfectly well. Strange as DW and Chrome use the same layout engine. Have I done something wrong or is this a bug in DW ? Here is the sailent code:
    Body{
         font-family: Arial, Helvetica, sans-serif;
         color:#666666;
         font-size: .75em;
         background-image: url(images/long_vertical.jpg);
         background-repeat:repeat-x;
    #container{
         background-image: url(images/whole_body.jpg);
         width:1034px;
         height:890px;
         margin: -15px auto 0px auto;

    Thank you for your help !!
    bringing my attention to the doc type ( utf 8 ) made me see that the doc type was placed below the obligatory Wordpress template description. Once I put it on the top of the css doc where it belongs it render perfectly well in live view.
    The obvious defeats us !
    Thanks Vincej 

  • Why does TS Operator Interface Resource file not update panel labels correctly?

    There seems to be a problem with TS1.0.2 with the retrieval of Resource strings. If there are other INI files in the Components\User\Language\English directory other than the "OperatorInterfaceStrings.ini" file, the default operator interface seems to randomly use other files when attempting to get the resource strings to update my panel labels. The problem occured when I created a copy of the original "copy*.ini" file and my OI kept using the text values from the old file even after closing the OI and restarting it. Would like to know why.

    Hi Todd,
    In the \User\Language\English directory should be a file called CustomStrings.ini.
    Put your additional Resource strings in this file and keep your default ini files unaltered in the \NI\.. folder.
    Follow the structure as per the default inis and as per the user manual.
    This should sort your problem out.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Safari not rendering Arabic text correctly

    I have Safari 1.0.3 running on Mac OS 10.2.8 and it will not render Arabic text correctly. Isolated letters appear at about half the correct size, which makes pages readable but only with considerable difficulty and annoyance.
    I saw some solutions here that related to removing Microsoft fonts, but I removed all fonts from Home:Library:Fonts and quite and restarted Safari, and the problem persists. I also downloaded Firefox 2.0 and the same issue occurs - with the added feature that the tab titles on Firefox also display this anomaly, whereas tab titles on Safari render Arabic correctly.
    And by the way, if this issue can be resolved, can safari and other apps be got to use a font other than the extremely ugly and hard-to-read default?
    iMac   Mac OS X (10.2.x)  

    Thanks Tom. The problem though is not that letters
    that are meant to be connected are coming out
    isolated; letters that are meant to be isolated, e.g.
    initial alif, waw, ra and final letters after alif,
    waw ra, are displaying way too small.
    Sorry I misunderstood the problem.
    Do you think it is worth trying your troubleshooting
    tip no. 18? And do you have any idea what sort of
    issue could be behind it that it would affect Firefox
    too?
    Yes, you may as well try no. 18. That tip, which really has no logic to it, reflects the fact that voodoo is sometimes required to get Jaguar to display Arabic correctly in browsers. Panther was a tremendous improvement in that regard.

  • Animated Gif Image does not render correctly on screen

    I have added animated gif image to the scene it does not render correctely.it shakes on the screen. plz give me any suggestion
    i use following code
    Image logo= new Image(getClass().getResourceAsStream("images/image.gif"));
    logoLabel.setGraphic(new ImageView(logo));

    Hello user,
    I think gif are rendered smoothly.
    Are you sure you are not making many object of same images everytime?
    Thanks.
    Narayan

  • Web pages posted to .Mac using iWeb do not render correctly on IE

    Okay, let's face it - most people out there use Internet Explorer (IE) to view web pages. I just published my web page using iWeb onto my iMac account. The web site renders correctly on my Mac, but does not render correctly on my PC using IE at work. Several other people using IE saw similar problems. For example, IE does not show the links until you run your mouse over them. Also, the text renders as an image (you cannot select text individualy). What do I do to ensure that all the world views the site correctly? Thanks.

    Welcome to the discussions, stoma.
    You'll have to essentially dumb your site down to IE level. Get rid of the cool effects, the transparencies, the rotated images, basically everything that makes iWeb so impressive to use. Make a nice plain site with no frills and you're 90% of the way to near 100% IE compatibility.
    Take all of your images and edit them outside of iWeb (like with other web applications) and that's another significant chunk. There will be a few bits left over, but some of those will be things you can't do anything about (like some of the page elements being created as .png's). You'll be as close to IE compatible as you can get with iWeb.
    Post your URL to let other users post as to what your SPECIFIC site would need.

  • Just upgraded my workstation and render nodes to AE CC 2014 and now I receive a "render control file not valid" upon rendering out.

    I just upgraded my workstation and render farm to AE CC 2014 and now I receive a "render control file not valid" on my render nodes when I try and render out an image sequence. Any ideas why the update would cause this? All my machines are updated to the latest version of AE CC 2014. Thanks!

    Sorry I meant "Update". I was using AE CC, Installed AE CC 2014 on all my machines recently.

  • CS4 Design view does not render CSS correctly but browser does !?!?

    I am designing a layout using primarily CSS. I want to insert a table inside one of the div's. In design view the table gets pushed way out of position but in live view and on the web, the page looks correct. Why? Am I missing something in design view?
    Here is the actual page I am working on Sample Page
    Here is what I see in design view Design View
    This glitch is making it difficult to add content to the table.
    I tried to edit the page with Contribute CS4 and the table gets pushed so far out of position that it is impossible to access it. The page looks fine when I am connected but as soon as I try to edit it does not render properly.

    This question comes up almost daily, and I dont recall seeing an answer that is much different.  It comes down to that it does not matter what DV shows, it is the browser view that counts.  How frustrating it is to spend time and effort to correct a view in DW Design, only to find out it throws your browser view all askew. Its hard enough to make x number of different browsers all look good with however many screen resolutions, to worry about something that in the end does not matter.....
    Work more in code view, let F12 be your companion.
    Gary

  • .pdf does not render correctly

    Hello everyone:
    When creating a .pdf from a .html dreamweaver file it does not render properly. Headings go to the left and sidebar images do not display properly. Any ideas as to how to fix this. Using Adode Acrobat 8 Professional and Adobe Dreamweaver CS3. Many Thanks

    Take a screenshot of the page then convert that to a PDF.
    The PrtScr key on the keyboard only captures what you can see on screen (or the active window).
    To get the entire page, either use something like SnagIt (commercial) or use one of the free add-ons for Firefox.
    Edit: or as Paula suggests, create a print stylesheet.
    http://www.alistapart.com/articles/goingtoprint/
    Message was edited by: John Waller

  • Chromebook 14-x050nr Not Rendering Web Page Correctly

    My new 14-x050nr does not render the following web page properly:
    http://cloud.collectorz.com/opus1269/books
    Near the top left of the page are labels "Author" and "All".  Left clicking on them should display a drop down menu for further selections. This does not happen.  There are several other labels on the page with drop downs and none of them work.
    I talked to my brother who has an older model ASUS Chromebook and the page functions correctly. Also works correctly on my Windows 7 laptop.
    I tried the following on my Chromebook without success:
    Logging in as guest
    Reset Settings
    Powerwash
    Switching to the Beta Channel
    Here is some further info. on my box:
    Model: 14-x050nr
    PN:        J9M96UA#ABA
    SN:       [Personal Information Removed]
    Chrome OS
    Version 39.0.2171.96
    Platform 6310.68.0 (Official Build) stable-channel nyan_blaze
    Firmware Google_Nyan_Blaze.5771.63.0
    If anyone else has this model I would appreciate if you could try the link and see it it works for you.
    Any other suggestions would be appreciated.

    Hello @opus1269,
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I have read your post on how your Chromebook is not able to render a certain webpage: Collectorz.com properly, and I would be happy to assist you!
    To further diagnose this issue, i recommend taking a look at this document on Changing the Chrome Web Browser Settings on Your HP Chromebook or Chromebox (Chrome OS). This should help to make the web content from Collectorz.com more accessable on your browser. If the issue continues, I recommend contacting Collectorz.com Customer Support for further assistance with their website.
    If their site is functioning normally on your installed browser, please call our technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region.
    http://www8.hp.com/us/en/contact-hp/ww-phone-assis​t.html
    I hope this helps!
    Regards
    MechPilot
    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 right to say “Thanks” for helping!

  • ADF panelGroup component's background image in CSS does not render

    Hi,
    I have an issue with the panelGroup component, where a background-image specified in the styleClass DOES NOT RENDER when deployed on the OAS. It works fine when I run the page on my local OC4J.
    I've verified that the image I use is deployed correctly on the server.
    We are using :
    JDeveloper Studio Edition: 10.1.3.3.0.4157 (Build JDEVADF_10.1.3.3.0_NT_070619.1129.4157)
    Oracle Application Server: 10.1.3.5.0 running on RHEL 5.
    I'm customizing pages of an ADF application to change the branding and skinning. The page header region used in the application uses a 'panelPageHeader' and the image I need to introduce is part of branding and must be rendered above the application menus (2 levels: 1->MenuTabs, 2-MenuBar).
    If it would help to see how my page renders locally, here's the link: http://tech-nik-alley.blogspot.com/2010/09/adf-panelgroups-background-image.html
    (The brightly colored bar above the menus is newly introduced, ABC_Lightbar.jpg).
    Using an objectImage with my light_bar image as source, directly in the facet menu2, causes the alignment of all pages to get disrupted. Hence the work-around of using the image as a background.
    A copy of my pageHeader region is below, with comments. The panelGroup component newly introduced is in the facet "menu2". I've added the CSS definitions in the page as comments as appropriate.
    Any pointers on how to debug further, work-arounds etc. are appreciated.
    TIA and regards
    Deepak.
    =====MY PAGE HEADER REGION====
    <af:regionDef var="attr">
    <af:panelPageHeader styleClass="ss0" > <!—ss0 is "padding:0px;margin-left:14%;margin-right:14%;margin-top:0px;margin-bottom:0px;display:block;background-color:transparent;" -->
    <f:facet name="branding">     
    <af:panelGroup styleClass="ss_brand"> <!--ss_brand is "display:block;margin-bottom:12px" -->
    <af:objectImage shortDesc="#{imageBean['SS_COMPANY_LOGO'].description}"
    source="#{imageBean['SS_COMPANY_LOGO'].physicalName}"/>
    </af:panelGroup>
    </f:facet>
    <f:facet name="menuGlobal" >
    <af:panelGroup layout="horizontal" styleClass="ss00" rendered="#{attr.globalMenuShown}">     <!—ss00 is "margin-right:10px;" -->
    <f:facet name="separator">
    <af:objectImage source="#{imageBean['SS_GLOBAL_SEPARATOR'].physicalName}" shortDesc=""/>
    </f:facet>
    <af:menuButtons>
    <af:goMenuItem text="#{sessionBean.authenticated?pageHeaderBean.loggedInUserInfo:messageBean.SS_GEN_GUEST}"/>
    </af:menuButtons>
    <af:menuButtons startDepth="0" var="menuGlobal" value="#{menuModel.model}">
    <f:facet name="nodeStamp">
    <af:goMenuItem text="#{menuGlobal.label}"
    destination="#{menuGlobal.fileName}"
    rendered="#{menuGlobal.type=='global' &amp;&amp; menuGlobal.rendered}"
    />
    </f:facet>
    </af:menuButtons>
    </af:panelGroup>
    </f:facet>
    <f:facet name="menu1" >
    </f:facet>
    <f:facet name="menu2" >     <!-- facet menu2 originally has a 'menuTabs' (level 1 menu) on top of a 'menuBar' (level 2 menu) -->
                        <!-- Change required: introduce a light_bar image above level 1 menu (menuTabs). The image spans the page -->
    <af:panelGroup rendered="#{skinFamily.menuLayout=='horizontal' and attr.otherMenuShown}">
         <!--Change: new panelGroup introduced, with a background image in the styleClass -->
    <af:panelGroup layout="vertical" styleClass="pageHeaderLightBar"> <!-- pageHeaderLightBar is "background-image:url(/ss/skin/ABC/images/ABC_lightbar.jpg); " -->
    <!--<af:objectImage source="/ss/skin/ABC/images/ABC_lightbar.jpg"/>-->     <!--Specifying the image directly, disrupts the all other OOTB pages-->
    <af:objectSpacer width="22px"/>
    </af:panelGroup>
    <af:panelGroup styleClass="pageHeaderMenuLevelOne"> <!-- Another place where a back-ground image is used for a panelGroup using the styleclass -->
    <af:menuTabs startDepth="0" var="menuTab" value="#{menuModel.model}">     <!-- The level 2 menu using menuTabs -->
    <f:facet name="nodeStamp">
    <af:goMenuItem text="#{menuTab.label}"
    destination="#{menuTab.fileName}"
    rendered="#{menuTab.rendered and menuTab.type!='global'}"/>
    </f:facet>
    </af:menuTabs>
    <af:menuBar startDepth="1" var="menuBar" value="#{menuModel.model}">     <!--The level 2 menu using a menuBar -->
    <f:facet name="nodeStamp">
    <af:goMenuItem text="#{menuBar.label}"
    destination="#{menuBar.fileName}"
    rendered="#{menuBar.rendered}" />
    </f:facet>
    </af:menuBar>
    </af:panelGroup>
    </af:panelGroup>
    </f:facet>
    </af:panelPageHeader>
    </af:regionDef>
    ===================================

    'background-image:url("../image/Sunset.jpg")' is a relative URL... relative to the final generated markup. It should be wrong like 99% of the times. You should rather use a styleClass and deal with the background-image with skinning as the skinning engines knows how to deal with such urls. Note that you'll most likely have to define a new resource loader and servlet mapping for the ResourceServlet. I know someone made a blog entry about that, was it Frank or Shay? Hmmm cannot remember... Maybe John as well. Anyway a Google search should yield good results for adf resource loader I think.
    Regards,
    ~ Simon

  • AIR application with Flex 4.5 will not render content. What gives?

    OK,
    So I've upgraded to Flash Builder 4.5 Premium and I am unable to develop desktop AIR applications with the 4.5 Flex SDK. I start by simply creating a brand new AIR application using the default SDK (Flex 4.5). I set the title property on WindowedApplication and include a simple Label component. The project compiles fine but when I run the application all I see is the adl window in the dock but that's it. If I modify the Main-app.xml file to set the visible attribute to true, I will get a small window but there is no content although the output window shows the application swf being loaded. Checking the release version of the Main-app.xml file shows the correct path location to the swf.
    Here is what I've tried so far:
    Install/reinstall Flash Builder, 4+ times
    Downloaded the trial installation twice
    Downloaded the SDK's for 3.6, 4.1 and 4.5.0. I then copied each SDK folder and merged the AIR 2.6 SDK with each copy. So now I have 6 SDK versions; one pristine and the other with the AIR 2.6 SDK merged. I then added each SDK individually and created an AIR desktop application for each. Each and every one works fine with the exception of the two 4.5 SDK's. They will not render content.
    I created a simple creation complete handler for the application that declares a simple variable and assigns a value to it. I then put a break point on the assignment and it never gets caught. More evidence that the swf isn't getting loaded.
    The computer I'm running on is a Mac Book Pro with Snow Leopard 10.6.7. If I create a web project in each of the 6 SDK's, those will work just fine. What the heck is it with Flex 4.5 and the AIR 2.6 SDK on this machine? I have the AIR 2.6 runtime installed as well as a number of AIR applications that work just fine. I also tried my 4.5 test on my windows machine and that worked like a champ.
    I am completely out of ideas. Finding information has been difficult because everyone is all about mobile so searching for desktop issues is a losing battle. I realize this is a long email but I'm desperate for help. There must be someone out there that knows more about the low level interaction between Flex 4.5/AIR 2.6 and the OS.

    Well, I finally found the issue, a corrupted mm.cfg file in /Library/Application Support/Macromedia. I deleted the file and then adl ran just fine.

  • Button in custom component not showing

    I made a very simple custom component with a TextField and Button but when I add multiple instances of it to a Layout, only the first Button shows up while the other show only when I focus the corresponding TextField. I'm quite new to fx and I'm not sure I did everything correctly but I don't see any obvious error in my code.
    The component:
    public class TestComponent extends BorderPane {
        @FXML
        private Button browseButton;
        @FXML
        private TextField textField;
        public TestComponent() {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this);
            fxmlLoader.setController(this);
            try {
                fxmlLoader.load();
            } catch (IOException exception) {
                throw new RuntimeException(exception);
    The fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
        xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"
                textAlignment="CENTER"  />
        </right>
    </fx:root>
    and the test code
    @Override
        public void start(Stage primaryStage) {
            VBox box = new VBox(5);
            box.setPadding(new Insets(5));
            TestComponent a = new TestComponent();
            TestComponent b = new TestComponent();
            TestComponent c = new TestComponent();
            box.getChildren().addAll(a, b, c);
            Scene scene = new Scene(box);
            primaryStage.setScene(scene);
            primaryStage.show();
    I'm running on Ubuntu with jdk-8-ea-bin-b111-linux-i586-10_oct_2013. I tested with jdk 1.7.0_40 and the buttons don't show.
    I'd include screenshots but the button to add images is disabled.
    Thanks for the help

    The issue is with the bind definition in the FXML, if you remove that definition, the buttons will display.
       prefHeight="${textField.height}"
    I think the binding is working, but when there is some kind of error (bug) in the layout process such that the scene is not automatically laid out correctly when the binding occurs.
    You can get exactly the same behaviour by removing the binding definition in FXML and placing it in code after the load.
                browseButton.prefHeightProperty().bind(textField.heightProperty());
    When the scene is initially displayed, the height of all of the text fields is 0, as they have not been laid out yet, and the browser button prefHeight gets set to 0 through the binding.
    That's OK and expected.
    Then the scene is shown and a layout pass occurs, which sets the height of the text fields to 26 and the prefHeight of all of the browser buttons adjust correctly.
    That's also OK and expected.
    Next the height of one of the buttons is adjusted via a layout pass.
    That's also OK and expected.
    But the height of the other buttons is not adjusted to match their preferred height (probably because a layout pass is not run on them).
    That is not OK and not expected (and I think a bug).
    If you manually trigger a layout pass on one of the components which did not render completely, the button will be displayed - but that should not be necessary.
    You can file a bug against the Runtime project at:
       https://javafx-jira.kenai.com/
    You will need to sign up at the link on the login page, but anybody can sign up and log a bug.
    Here is some sample code.
    import javafx.application.Application;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ComponentTestApp extends Application {
      @Override
      public void start(Stage primaryStage) {
        VBox box = new VBox(5);
        box.setPadding(new Insets(5));
        TestComponent a = new TestComponent();
        TestComponent b = new TestComponent();
        TestComponent c = new TestComponent();
        box.getChildren().addAll(a, b, c);
        Scene scene = new Scene(box);
        primaryStage.setScene(scene);
        primaryStage.show();
        b.requestLayout(); // I don't understand why this call is necessary -> looks like a bug to me . . .
      public static void main(String[] args) {
        launch(args);
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.fxml.FXML;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.control.Button;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.BorderPane;
    import java.io.IOException;
    public class TestComponent extends BorderPane {
        private static int nextComponentNum = 1;
        private final int componentNum = nextComponentNum;
        @FXML
        private TextField textField;
        @FXML
        private Button browseButton;
        public TestComponent() {
          nextComponentNum++;
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("TestComponent.fxml"));
            fxmlLoader.setRoot(this); 
            fxmlLoader.setController(this); 
            try { 
                fxmlLoader.load();
                browseButton.prefHeightProperty().bind(textField.heightProperty());
                System.out.println(componentNum + " " + browseButton + " prefHeight " + browseButton.getPrefHeight());
                textField.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + textField + " height " + newValue);
                browseButton.prefHeightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " prefHeight " + newValue);
                browseButton.heightProperty().addListener(new ChangeListener<Number>() {
                  @Override
                  public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    System.out.println(componentNum + " " + browseButton + " height " + newValue);
                    new Exception("Not a real exception - just a debugging stack trace").printStackTrace();
            } catch (IOException exception) {
                throw new RuntimeException(exception); 
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.HBox?>
    <fx:root type="javafx.scene.layout.BorderPane" xmlns:fx="http://javafx.com/fxml/1"
             xmlns="http://javafx.com/javafx/2.2">
        <center>
            <TextField fx:id="textField" prefWidth="200.0" />
        </center>
        <right>
            <Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"
                    minHeight="-Infinity" text="Browse"
                    textAlignment="CENTER"  />
            <!--<Button fx:id="browseButton" mnemonicParsing="false" maxHeight="-Infinity"-->
                    <!--minHeight="-Infinity" prefHeight="${textField.height}" text="Browse"-->
                    <!--textAlignment="CENTER"  />-->
        </right>
    </fx:root>
    Here is the output of the sample code:
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 0.0
    1 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    1 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    2 TextField[id=textField, styleClass=text-input text-field] height 26.0
    3 Button[id=browseButton, styleClass=button]'Browse' prefHeight 26.0
    3 TextField[id=textField, styleClass=text-input text-field] height 26.0
    2 Button[id=browseButton, styleClass=button]'Browse' height 26.0
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    java.lang.Exception: Not a real exception - just a debugging stack trace
      at testcomponent.TestComponent$3.changed(TestComponent.java:69)
      at testcomponent.TestComponent$3.changed(TestComponent.java:65)
      at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347)
      at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
      at javafx.beans.property.ReadOnlyDoubleWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:177)
      at javafx.beans.property.ReadOnlyDoubleWrapper.fireValueChangedEvent(ReadOnlyDoubleWrapper.java:143)
      at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
      at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
      at javafx.scene.layout.Region.setHeight(Region.java:915)
      at javafx.scene.layout.Region.resize(Region.java:1362)
      at javafx.scene.layout.BorderPane.layoutChildren(BorderPane.java:583)
      at javafx.scene.Parent.layout(Parent.java:1063)
      at javafx.scene.Parent.layout(Parent.java:1069)
      at javafx.scene.Scene.doLayoutPass(Scene.java:564)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2341)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:329)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    1 Button[id=browseButton, styleClass=button]'Browse' height 26.0

Maybe you are looking for

  • PI 7.1 high availability - adapter framework error

    Hello, I've Configured PI 7.1 with SLD and getting error in RWB: Message: Cannot construct URL for runtime check using entries in SLD for component af.xip.hfabwsappxdb; correct the entries in SLD Stacktrace: com.sap.aii.rwb.exceptions.OperationFailed

  • QT won't open AVI's after moving to new MacBook

    Hi guys, I just upgraded to a MacBook, moving my files from a G3 iBook --including a bunch of short AVI's I'd made using a Canon digital camera. On the G3, QT opened these no problem. But on the MacBook, QT crashes whenever I try. What's up with this

  • Compressing video for the web

    I have had people ask me to make a short 30 clip for the web say of some of there sporting shots, what is the best way to go about knowing what kind of compression you use and what type of file is best.

  • Properties Panel Question

    Hi, I really dislike the "Properties Panel" on the bottom of the DW UI. Is there a way to have it run vertical on the left of the UI or make it collapsible like all of the other panels? Thanks

  • Glitchy, Halty Play back on movie originally created in V5

    I created an Imovie in version 5 and it played well, then I upgraded my system to V6 and opened this movie, I found the replay to be glitchy, halty, and overall poor playback performance. I created a similar version of the movie in Version 6( it was