Tab pane height minimum / inconsiste​nt behaviour

Hi,
I run into a small but annoying issue with tab controls. (LabView2009f2)
I want to set the height of the tab control as small as possible.
- Using property nodes (as in attached example) the minimum height is 31 pixels. With 30 pixels and below an error message is shown ("invalid value").
- Using the property dialog for the tab I can set height to 1 and setting will be accepted. However after re-opening the dialog the height is changed to 5.
- After manually setting height to 5, the tab height changes back to 31 as soon as any of the tab properties is changed (like number of tabs, their names, and so on...) - annoying!
- It doesn't matter if I'm using a classic or a modern style tab.
So my questions:
Why is the behaviour inconsistent between changing properties manually and programmatically?
Why does the tab control allow a height of 5 pixels (atleast by manual setting), but doesn't maintain it afterwards?
The quick&dirty workaround is to draw a decoration above the tab pane, but using just one property node would be much cleaner...
Message Edited by GerdW on 11-05-2009 01:46 PM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
TabPaneHeight.vi ‏9 KB

Hi,
thank you for descriping your problem so detailed.
I've told our R&D department about that. If you want to know about the status you can call the NI Support and ask for information on CAR #195219.
Actually I don't know when this behaviour will be fixed or if there are only a more detailed informations in the documentation with a minimum value for the tab panel height.
Sorry I can't tell you more about that right now.
Thanks for reporting this to us.
Regards,
Schilli

Similar Messages

  • Have HTML content on Tabbed Panes

    I'm trying to add HTML content to tabbed panes in an Applet environment.
    Here is the code:
    import java.awt.*;
    import javax.swing.*;
    <APPLET
    CODE = tabbedpane.class
    WIDTH = 400
    HEIGHT = 200 >
    </APPLET>
    public class tabbedpane extends JApplet
    public void init()
    Container contentPane = getContentPane();
    JTabbedPane jtabbedpane = new JTabbedPane();
    JPanel jpanel1 = new JPanel();
    JPanel jpanel2 = new JPanel();
    JPanel jpanel3 = new JPanel();
    jpanel1.add(new JLabel("This is panel 1"));
    jpanel2.add(new JLabel("This is panel 2"));
    jpanel3.add(new JLabel("This is panel 3"));
    jtabbedpane.addTab("Tab 1",
    new ImageIcon("tab.jpg"),
    jpanel1, "This is tab 1");
    jtabbedpane.addTab("Tab 2",
    new ImageIcon("tab.jpg"),
    jpanel2, "This is tab 2");
    jtabbedpane.addTab("Tab three",
    new ImageIcon("tab.jpg"),
    jpanel3, "This is tab 3");
    contentPane.setLayout(new BorderLayout());
    contentPane.add(jtabbedpane);
    Could anyone tell me how can i add html content to this panes?
    Thanks
    Cesar

        JLabel l = new JLabel ("<html><font color = 'blue'>Hello world</font>") ;Foxcoming

  • Tabbed panes inside panels!!! (not dialogs)

    hello,
    i want to have tabbed panes inside panels. is this possible? if yes, how?

    It seems the best solution to this issue is to ditch the Spry Tabbed Panel and use a javascript tabbed panel. User971824 in Stack Overflow explained the problem as follows:
    "I had this issue and it's because your gallery is hidden on page load so the plugin cannot read the container width and height in order for it to render properly. Instead of initializing the plugin on page load initialize it when the user clicks on the tab. If you have any animation on the tab windows makes sure you initialise flexslider after the animation is complete."
    "You are using spryTabbedPanels for your tabbed pages. I looked at the API and they dont seem to have an animation complete function so until you sort out that end you wont be able to fix it. You need a way to detect once the panel has shown so that you can initialize the carousel."

  • How to use tab-pane-floating?

    What does "The styleclass is "tab-pane-floating" if the TabPane is floating" or "STYLE_CLASS_FLOATING" mean?
    Can "tab-header-area" and "tab-content-area" be used separately ? ( to put "tab-header-area" in a toolbox and "tab-content-area" elsewhere.)
    How can a button be put into "tab-header-area" ? ( "New Tab" button, like browsers have, for example).

    It seems that floating tabs mode and style are to be used when... floating (dragging?) tabpane. TabPane.STYLE_CLASS_FLOATING not only change some styles (see caspian.css) but also prevents ".tab-header-background" to be created.I don't think we are much closer to understanding the true purpose of the floating style for tabpane and would need somebody else to document it to elucidate it. I have sent a request to the JavaFX documentation team for a tutorial for TabPane, and hopefully they can provide example usage of the floating styles (and other TabPane features) there.
    newTabButton must then be translated in appropriate position, as if Side is TOP, LEFT,etc. and for *.tab-header-area do some -fx-padding to make room for newTabButtonStackPane.setAlignment(node, pos) may help with the translation and standard -fx-padding css for the button control can accomplish the padding.
    http://docs.oracle.com/javafx/2/api/javafx/scene/layout/StackPane.html#setAlignment%28javafx.scene.Node,%20javafx.geometry.Pos%29
    Of course, not for floating tabs since it uses ".tab-header-background" StackPane to layout newTabButt.Yeah, one of the reasons why using the css selectors to lookup nodes in complex controls for manipulation, is a bit of a risky strategy.
    Another solution : create a StackPane . Add TabPane on StackPane , and then add newTabButton (use LayoutX,LayoutY to put it in appropriate position ). In TabPane, make room for newTabButton by shifting .tab-header-area with some -fx-padding. Simpler but needs one extra StackPane .This solution seems more robust.
    I saw willow-browser before, as a starting point. For every tab, there is an (unused) "tab-content-area --StackPane". Yes, I did it that way because I wanted the tabs placed in a general navigation bar with forward and back buttons, location field and other controls in it (similar to IE9) and the pane layout for tabs didn't seem flexible enough for me to do that as it placed the panes directly under the tabs. The unused stackpane there is actually a zero height but with a width which forces the tabPane control to just become a set of tabs without content sized only to the width allocated in the UI for the tabs themselves, and not the real browser window content, then I just react on the tabs like buttons to swap in and out different webviews in a stack for the main browser display. In some ways this accomplished the decoupling of the tabs in tab headers from tab content in a seperate pane.
    I think that the real solution is to put the "new tab" button inside "tab-header-area". Perhaps, I found it easier just create a seperate new tab button and lay it out seperately from the tab header area. In addition to being easier, it also seemed more flexible, because then I could place the new tab button wherever I wanted in the UI rather than just directly next to the tabs in the tab-header-area.

  • How can I make a tabbed pane transparent ?

    I have a tabbed pane placed on a JPanel with an image background. I added a tabbed pane with tabbedPane.setOpaque (false), however I still can't see the image behind the components that were added as tabs in the tabbedpane. Any help will be greatly appreciated.
    Here's a simplified version of the code:
    public class Example extends JPanel {
         public Example() {
              tabs = new JTabbedPane();
              tabs.setOpaque (false);
              JPanel tp1 = new JPanel();
              tp1.setOpaque(false);
              tabs.addTab ("panel 1", tp1);
              this.add (tabs);
         public void paintComponent(Graphics g) {
              // Paint background image
              g.drawImage(...);
    }

    Perhaps the opaque property is internally overset by the tab pane.
    Try this:
       public class Example extends JPanel {
          public Example() {
             JTabbedPane tabs = new JTabbedPane() {
                public boolean isOpaque() {
                   return false;
             JPanel tp1 = new JPanel() {
                public boolean isOpaque() {
                   return false;
             tabs.addTab("panel 1", tp1);
             this.add (tabs);
          public void paintComponent(Graphics g) {
             // Paint background image
             g.drawImage(...);
       } Regards.

  • How can i place button on top right hand corner of the tabbed pane

    Hi all,
    i want to place button on top right hand corner of the tabbed pane, just run the code below, i have add button(it going to insert tab into tabbedpane), i want to place that tab into top right hand corner of the tabbedpane (not inside the tab itself). if i set tab policy setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT), it will give two button at right hand corner along with those buttons i want to and one more add button.
    please suggest so that i can move forward.
    Thanks in advance
    import java.awt.Dimension;
    import java.util.HashMap;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    * @author  Dayananda.BV
    public class TabpaneDemo extends javax.swing.JFrame {
        /** Creates new form TabpaneDemo */
        HashMap<Integer, tabpanel> panelMap = new HashMap<Integer, tabpanel>();
        public TabpaneDemo() {
            initComponents();
            createFloorPlan();
            getContentPane().setPreferredSize(new Dimension(400,400));
            jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jTabbedPane1 = new javax.swing.JTabbedPane();
            add_tab_button = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            add_tab_button.setText("+");
            add_tab_button.setMargin(new java.awt.Insets(0, 0, 0, 0));
            add_tab_button.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    add_tab_buttonActionPerformed(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(308, Short.MAX_VALUE)
                    .addComponent(add_tab_button, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(67, 67, 67))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(add_tab_button)
                    .addGap(8, 8, 8)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void createFloorPlan(){
            tabpanel floorplan_Panel = new tabpanel(panelMap.size()+1);
            panelMap.put(floorplan_Panel.getTabIndex(), floorplan_Panel);
            jTabbedPane1.add(floorplan_Panel, floorplan_Panel.getTabName());
            jTabbedPane1.setSelectedIndex(jTabbedPane1.getTabCount()-1);
        private void add_tab_buttonActionPerformed(java.awt.event.ActionEvent evt) {                                              
            createFloorPlan();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new TabpaneDemo().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JButton add_tab_button;
        private javax.swing.JTabbedPane jTabbedPane1;
        // End of variables declaration                  
        class tabpanel extends JPanel{
            private int tabIndex = 0;
            private String tabName ;
            public tabpanel(int tabIndex) {
                this.tabIndex = tabIndex;
                if(tabIndex >= 10) {
                    tabName = "Floor Map"+tabIndex;
                } else{
                    tabName = "Floor Map"+tabIndex+"  ";
            public int getTabIndex(){
                return tabIndex;
            public String getTabName(){
                return tabName;
    }Thanks
    Dayananda B V

    This part of tabbed pane is not customizable as it lies in the ComponentUI(TabbedpaneUI) portion of the tabbedpane.
    But I can point out the place u can change to bring the desired feature into effect.
    U can find an Inner class called ScrollableTabSupport
    Look for the methods createButtons where u can create extra buttons and add to the tabbed pane.
    The Inner class also implements actionListener where u can implement the action for the button u added.
    By this method U have to use your own extended TabbedPaneUI which u cant escape from.
    Hope this will help u.

  • How to a particular panel in a tabbed pane to the front?

    Hello
    I have a small application that uses a tabbed pane. At some point I want to press a button in one of the panels of the tabbed pane and then another panel in the same tabbed pane to show up, as if I had clicked on that tab to bring it to the front.
    Only difference is I don't want to click on the tab to do it but on another button, so I can do some more stuff through the button before I bring the other panel to the front
    I thought I could do this by getting focus, but it seems not to be the case. Getting focus does not mean coming to the front as I originally thought.
    I hope this is clear. Here is an example that you can compile and run. I want to get jpanel2 to the front by clicking jbutton1 and vice versa.
    Any help appreciated.
    (Frame1.java)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
        private JTabbedPane jTabbedPane1 = new JTabbedPane();
        private JPanel jPanel1 = new JPanel();
        private JPanel jPanel2 = new JPanel();
        private JButton jButton1 = new JButton();
        private JButton jButton2 = new JButton();
        private JTextField jTextField1 = new JTextField();
        private JTextField jTextField2 = new JTextField();
        public Frame1() {
            try {
                jbInit();
                this.setDefaultCloseOperation(EXIT_ON_CLOSE);
                setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
        private void jbInit() throws Exception {
            this.getContentPane().setLayout( null );
            this.setSize( new Dimension(400, 300) );
            jTabbedPane1.setBounds(new Rectangle(0, 0, 395, 270));
            jPanel1.setLayout(null);
            jPanel2.setLayout(null);
            jButton1.setText("jButton1");
            jButton1.setBounds(new Rectangle(20, 170, 160, 25));
            jButton1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            jButton1_actionPerformed(e);
            jButton2.setText("jButton2");
            jButton2.setBounds(new Rectangle(20, 135, 160, 25));
            jButton2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            jButton2_actionPerformed(e);
            jTextField1.setBounds(new Rectangle(55, 45, 210, 20));
            jTextField2.setBounds(new Rectangle(95, 50, 180, 20));
            jPanel1.add(jTextField1, null);
            jPanel1.add(jButton1, null);
            jTabbedPane1.addTab("jPanel1", jPanel1);
            jPanel2.add(jTextField2, null);
            jPanel2.add(jButton2, null);
            jTabbedPane1.addTab("jPanel2", jPanel2);
            this.getContentPane().add(jTabbedPane1, null);
        private void jButton1_actionPerformed(ActionEvent e) {
        private void jButton2_actionPerformed(ActionEvent e) {
        public static void main(String[] args) {
            new Frame1();
    }

    tabbedPane.setSelectedIndex(...);

  • Ideas for a "virtually" tabbed pane

    I'm developing on this application for keeping information about products and customers in a shop.
    In my "product manager" window I would like to have tabbed pane with an input interface for different types of goods in each tab respectively. But since the interface is more or less the same for different products (with fields like product name beeing persistent), it would be better to just alter the input components programmatically (in the pane's stateChanged event), rather than having to duplicate components for 7 different tabs... Hope my point gets through. This is strictly a matter of Look & Feel -- this is the most neat sollution i could think of :)

    mannamann wrote:
    I appreciate your commitment to ridding the forums of the "by getters". I know that my question was probably a little superficial, and something that I could have figured out myself. My goal is not to get rid of get byers, but I will want to expend more of my free time and effort helping those where the paybacks for me are greatest -- the highly motivated. It is truly amazing and gratifying to see those of this kind progress.
    But since the primary focus of our project is not GUI-programming, isn't it fair to post a "quicky" here, to draw some knowledge from experts like you? So that I don't have to spend my entire day working out UI, when I prefered to focus on the data model of my program. After all, isn't that what the forum is all about?It's about sharing knowledge, of course, but having said that, you can't ignore the human component either. We're all volunteers, and given our druthers, we'll put in more effort towards those who do likewise. You really can't expect otherwise, right?

  • How to drag and drop tab nodes between tab panes

    I'm working on example from this tutorial( Drag-and-Drop Feature in JavaFX Applications | JavaFX 2 Tutorials and Documentation ). Based on the tutorial I want to drag tabs between two tabs. So far I managed to create this code but I need some help in order to finish the code.
    Source
    tabPane = new TabPane();
    Tab tabA = new Tab();
       Label tabALabel = new Label("Main Component");
    tabPane.setOnDragDetected(new EventHandler<MouseEvent>()
                @Override
                public void handle(MouseEvent event)
                    /* drag was detected, start drag-and-drop gesture*/
                    System.out.println("onDragDetected");
                    /* allow any transfer mode */
                    Dragboard db = tabPane.startDragAndDrop(TransferMode.ANY);
                    /* put a string on dragboard */
                    ClipboardContent content = new ClipboardContent();
                    content.put(DataFormat.PLAIN_TEXT, tabPane);
                    db.setContent(content);
                    event.consume();
    What is the proper way to insert the content of the tab as object? Into the tutorial simple text is transferred. How I must modify this line content.put(DataFormat.PLAIN_TEXT, tabPane);?
    And what is the proper way to insert the tab after I drag the tab:
    Destination
    tabPane.setOnDragDropped(new EventHandler<DragEvent>()
                @Override
                public void handle(DragEvent event)
                    /* data dropped */
                    /* if there is a string data on dragboard, read it and use it */
                    Dragboard db = event.getDragboard();
                    boolean success = false;
                    if (db.hasString())
                        //tabPane.setText(db.getString());
                        Tab tabC = new Tab();
                        tabPane.getTabs().add(tabC);
                        success = true;
                    /* let the source know whether the string was successfully
                     * transferred and used */
                    event.setDropCompleted(success);
                    event.consume();
    I suppose that this transfer can be accomplished?
    Ref javafx 2 - How to drag and drop tab nodes between tab panes - Stack Overflow

    I would use a graphic (instead of text) for the Tabs and call setOnDragDetected on that graphic. That way you know which tab is being dragged. There's no nice way to put the Tab itself into the dragboard as it's not serializable (see https://javafx-jira.kenai.com/browse/RT-29082), so you probably just want to store the tab currently being dragged in a property.
    Here's a quick example; it just adds the tab to the end of the current tabs in the dropped pane. If you wanted to insert it into the nearest location to the actual drop you could probably iterate through the tabs and figure the coordinates of each tab's graphic, or something.
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.Tab;
    import javafx.scene.control.TabPane;
    import javafx.scene.input.ClipboardContent;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.input.TransferMode;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class DraggingTabPane extends Application {
      private static final String TAB_DRAG_KEY = "tab" ;
      private ObjectProperty<Tab> draggingTab ;
    @Override
      public void start(Stage primaryStage) {
      draggingTab = new SimpleObjectProperty<>();
      TabPane tabPane1 = createTabPane();
      TabPane tabPane2 = createTabPane();
      VBox root = new VBox(10);
      root.getChildren().addAll(tabPane1, tabPane2);
      final Random rng = new Random();
      for (int i=1; i<=8; i++) {
        final Tab tab = createTab("Tab "+i);
        final StackPane pane = new StackPane();
          int red = rng.nextInt(256);
          int green = rng.nextInt(256);
          int blue = rng.nextInt(256);
        String style = String.format("-fx-background-color: rgb(%d, %d, %d);", red, green, blue);
        pane.setStyle(style);
        final Label label = new Label("This is tab "+i);
        label.setStyle(String.format("-fx-text-fill: rgb(%d, %d, %d);", 256-red, 256-green, 256-blue));
        pane.getChildren().add(label);
        pane.setMinWidth(600);
        pane.setMinHeight(250);
        tab.setContent(pane);
        if (i<=4) {
          tabPane1.getTabs().add(tab);
        } else {
          tabPane2.getTabs().add(tab);
      primaryStage.setScene(new Scene(root, 600, 600));
      primaryStage.show();
      public static void main(String[] args) {
      launch(args);
      private TabPane createTabPane() {
        final TabPane tabPane = new TabPane();
        tabPane.setOnDragOver(new EventHandler<DragEvent>() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              event.acceptTransferModes(TransferMode.MOVE);
              event.consume();
        tabPane.setOnDragDropped(new EventHandler<DragEvent>() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              final Tab tab = draggingTab.get();
              tab.getTabPane().getTabs().remove(tab);
              tabPane.getTabs().add(tab);
              event.setDropCompleted(true);
              draggingTab.set(null);
              event.consume();
        return tabPane ;
      private Tab createTab(String text) {
        final Tab tab = new Tab();
        final Label label = new Label(text);
        tab.setGraphic(label);
        label.setOnDragDetected(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            Dragboard dragboard = label.startDragAndDrop(TransferMode.MOVE);
            ClipboardContent clipboardContent = new ClipboardContent();
            clipboardContent.putString(TAB_DRAG_KEY);
            dragboard.setContent(clipboardContent);
            draggingTab.set(tab);
            event.consume();
        return tab ;

  • CF 9.0.1 cflayout tab - first tab - content height problem in IE 7

    In IE 7, the first tab's height is incorrectly rendered - it is the combined height of the up/down arrows in the scroll bar instead of the tab's content. The rest of the tabs are rendered correctly. I am using IE 8, and changed the Document Mode to: "IE 7 Standards." It renders fine in IE 8 or even Quirks mode.
    I'm not sure if CF 9.0.1 update created this problem. Can someone test this code on CF 9.0?
    Here's a very simple test case - copy/paste this to a new .cfm file and take a look on IE 7 (or IE 7 Standards mode in IE 8)
    <cfoutput><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html style='height:100%;'>
    <head>
        <title>CF Tabs Example</title>
    </head>
    <body>
    </cfoutput>
    <cfajaximport tags="cflayout-tab">
    <cflayout type="tab">
        <cflayoutarea title="Tab 1">
            <cfoutput>
            <p>This is the first tab!</p>
            <p>This is the first tab!</p>
            <p>This is the first tab!</p>
            <p>This is the first tab!</p>
            <p>This is the first tab!</p>
            <p>This is the first tab!</p>
            </cfoutput>
        </cflayoutarea>
        <cflayoutarea title="Tab 2">
            <cfoutput>
            <p>This is the second tab!</p>
            <p>This is the second tab!</p>
            <p>This is the second tab!</p>
            <p>This is the second tab!</p>
            <p>This is the second tab!</p>
            <p>This is the second tab!</p>
            </cfoutput>
        </cflayoutarea>
    </cflayout>
    <cfoutput>
    </body>
    </html>
    </cfoutput>

    Correct. The first tab fully displays in IE 8 both compatibility mode and 'regular' mode when running on CF 9.0.0 (actually, maybe I should spell out: Coldfusion Server Developer 9,0,0,251028
    and does not work in Coldfusion Server Enterprise 9,0,1,274733  as I stated.
    I found some posts about making minor corrections to the "cflayout.js" but I think those were changes to the 9.0.0 scripts, because it was very different from the 9.0.1 cflayout.js script.
    Bottom line - I "fixed" it by putting in the fix script into CFIDE\scripts\ajax\package\cflayout.js
    And when I say the fix script it's almost the original 9.0.0 one, but I got it here:
    http://forums.adobe.com/thread/565912?tstart=0
    it was posted by "MrTee" on Feb 23rd in a reply.

  • Disposable tabbed pane redrawing

    Hi, i'm using disposable tabbed panes (with close button) in my program and i'm using following method to update their titles according to what user entered:
    //this is class extending JPanel
    public void updatePanelTitle(String newTitle) {
            MainPanel panel = (MainPanel) getParent(); //MainPanel extends JTabbedPane
            panel.setTitleAt(panel.getComponentZOrder(this)-1, newTitle);
            repaint();
        }Point is the title gets changed but the size of panel label does not. However, when i mouse-over the close button there, it gets changed to the size of the text.
    @Override
            public void mouseEntered(MouseEvent e) {
                Component component = e.getComponent();
                if (component instanceof AbstractButton) {
                    AbstractButton button = (AbstractButton) component;
                    button.setBorderPainted(true);
            }setBorderPainted calls inside the repaint method.
    Can anyone give a clue why it is not working or how to fix it?
    Regards,
    Marek

    Well its quite big but if it helps, this is the panel class:
    package presentationTier.view;
    import com.bbgroup.ui.Console;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.border.Border;
    import javax.swing.text.BadLocationException;
    import presentationTier.Model.Properties;
    import presentationTier.Model.PropertyInterface;
    import presentationTier.Model.StandardInputOutput;
    import presentationTier.controller.ConfirmListGeneratorAction;
    import presentationTier.controller.ConfirmSearchReplaceAction;
    import presentationTier.controller.OpenBrowseDialogAction;
    * @author marek
    public class ListGeneratorPanel extends JPanel implements StandardInputOutput, PropertyInterface {
        private JLabel labStartPath,  labExtensions;
        private JTextField txtStartPath,  txtExtensions;
        private JButton butBrowse,  butGo;
        private Console console;
        private GridBagConstraints c;
        private Insets labelInsets,  normalInsets;
        public ListGeneratorPanel() {
            super(new GridBagLayout());
            initComponents();
            borderCompononets(BorderFactory.createLoweredBevelBorder());
            resetConstraints();
            c.gridx = 0;
            c.gridy = 0;
            c.insets = labelInsets;
            add(labStartPath, c);
            c.gridx = 1;
            //c.gridwidth = 1;
            c.weightx = 1;
            c.insets = normalInsets;
            add(txtStartPath, c);
            c.gridx = 2;
            //c.gridwidth = 1;
            c.weightx = 0;
            add(butBrowse, c);
            c.gridx = 0;
            c.gridy = 1;
            c.weightx = 0;
            c.insets = labelInsets;
            add(labExtensions, c);
            c.gridx = 1;
            //c.gridwidth = 3;
            c.weightx = 1;
            c.insets = normalInsets;
            add(txtExtensions, c);
            c.gridx = 2;
            c.gridwidth = 1;
            //c.gridheight = 1;
            c.weightx = 0;
            add(butGo, c);
            c.gridx = 0;
            c.gridy = 2;
            c.gridwidth = 5;
            c.weighty = 1;
            add(new JScrollPane(console), c);
            resetConstraints();
        private void initComponents() {
            c = new GridBagConstraints();
            console = new Console(true);
            labelInsets = new Insets(5, 5, 0, 0);
            normalInsets = new Insets(5, 5, 0, 5);
            labStartPath = new JLabel("Search under:");
            labExtensions = new JLabel("File types:");
            txtStartPath = new JTextField();
            txtExtensions = new JTextField();
            butBrowse = new JButton(new OpenBrowseDialogAction(this));
            butGo = new JButton(new ConfirmListGeneratorAction(this));
        private void borderCompononets(Border b) {
            getTxtStartPath().setBorder(b);
            getTxtExtensions().setBorder(b);
        private void resetConstraints() {
            c.ipadx = 0;
            c.ipady = 0;
            c.gridwidth = 1;
            c.gridheight = 1;
            c.weightx = 0;
            c.weighty = 0;
            c.fill = GridBagConstraints.BOTH;
            c.anchor = GridBagConstraints.FIRST_LINE_START;
            c.insets = normalInsets;
        public Properties createProperties() {
            Properties p = new Properties();
            p.setSout(this);
            p.setStartPath(getTxtStartPath().getText());
            p.setExtensions(getTxtExtensions().getText());
            return p;
         * @param line
         * @throws BadLocationException
        public void echo(String line) throws BadLocationException {
            getConsole().echo(line);
         * @param line
         * @param style
         * @throws BadLocationException
        public void echo(String line, String style) throws BadLocationException {
            getConsole().echo(line, style);
        public void drawSeparator() throws BadLocationException {
            getConsole().drawSeparator();
        public void passBrowsedFilePath(String browsedFilePath) {
            getTxtStartPath().setText(browsedFilePath);
        public void updatePanelTitle(String newTitle) {
            MainPanel panel = (MainPanel) getParent();
            panel.setTitleAt(panel.getComponentZOrder(this) - 1, "Generate: " + newTitle);
            updateUI();
            repaint();
        public Console getConsole() {
            return console;
        public JTextField getTxtStartPath() {
            return txtStartPath;
        public JTextField getTxtExtensions() {
            return txtExtensions;
    }When you add instance of this to your JTabbedPane, you will get closeable Tabbed Pane with title you specified in addTab(title, component);
    I implement method updatePanelTitle(String newTitle); to change the title of this tab when suer submits the data. These action controllers that call submitting and updating title are in controller package. Problem is that the title itself is changed when data are submitted but the <b>size of the tab is not adjusted to newTitles length.</b> It is just adjusted when i pull my mouse over the close button that implements action from previous post. It's in this class:
    package com.bbgroup.ui;
    import javax.swing.*;
    import javax.swing.plaf.basic.BasicButtonUI;
    import java.awt.*;
    import java.awt.event.*;
    * Component to be used as tabComponent;
    * Contains a JLabel to show the text and
    * a JButton to close the tab it belongs to
    public class DisposableTabPanel extends JPanel {
        private final JTabbedPane pane;
        public DisposableTabPanel(final JTabbedPane pane) {
            //unset default FlowLayout' gaps
            super(new FlowLayout(FlowLayout.LEFT, 0, 0));
            if (pane == null) {
                throw new NullPointerException("TabbedPane is null");
            this.pane = pane;
            setOpaque(false);
            //make JLabel read titles from JTabbedPane
            JLabel label = new JLabel() {
                @Override
                public String getText() {
                    int i = pane.indexOfTabComponent(DisposableTabPanel.this);
                    if (i != -1) {
                        return pane.getTitleAt(i);
                    return null;
            add(label);
            //add more space between the label and the button
            label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
            //tab button
            JButton button = new TabButton();
            add(button);
            //add more space to the top of the component
            setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
        private class TabButton extends JButton implements ActionListener {
            public TabButton() {
                int size = 17;
                setPreferredSize(new Dimension(size, size));
                setToolTipText("Close this tab");
                //Make the button looks the same for all Laf's
                setUI(new BasicButtonUI());
                //Make it transparent
                setContentAreaFilled(false);
                //No need to be focusable
                setFocusable(false);
                setBorder(BorderFactory.createEtchedBorder());
                setBorderPainted(false);
                //Making nice rollover effect
                //we use the same listener for all buttons
                addMouseListener(buttonMouseListener);
                setRolloverEnabled(true);
                //Close the proper tab by clicking the button
                addActionListener(this);
            public void actionPerformed(ActionEvent e) {
                int i = pane.indexOfTabComponent(DisposableTabPanel.this);
                if (i != -1) {
                    pane.remove(i);
            //we don't want to update UI for this button
            public void updateUI() {
            //paint the cross
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                Graphics2D g2 = (Graphics2D) g.create();
                //shift the image for pressed buttons
                if (getModel().isPressed()) {
                    g2.translate(1, 1);
                g2.setStroke(new BasicStroke(2));
                g2.setColor(Color.BLACK);
                if (getModel().isRollover()) {
                    g2.setColor(Color.MAGENTA);
                int delta = 6;
                g2.drawLine(delta, delta, getWidth() - delta - 1, getHeight() - delta - 1);
                g2.drawLine(getWidth() - delta - 1, delta, delta, getHeight() - delta - 1);
                g2.dispose();
        private final static MouseListener buttonMouseListener = new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                Component component = e.getComponent();
                if (component instanceof AbstractButton) {
                    AbstractButton button = (AbstractButton) component;
                    button.setBorderPainted(true);
            @Override
            public void mouseExited(MouseEvent e) {
                Component component = e.getComponent();
                if (component instanceof AbstractButton) {
                    AbstractButton button = (AbstractButton) component;
                    button.setBorderPainted(false);
    }I cant possibly post a running code as it uses third party libraries and implements bunch of interfaces, it would require whole nearly whole view-controller part of the project.
    Another problem is that method getComponentZOrder(this) - 1, works for retrieving all tabs except the first one (it returns fine indexes for any tab but -1 for the first one) but sadly there is no such method like getIndex(Component) which would be useful for getting <b>this</b> components index.
    Thanks in advance for ideas.
    Regards, Marek

  • How to provide space between two tabs in a tabbed pane using Swings?

    I want to place two tabs on a tabbed pane with a specified gap in between. How to give the space between them. Please suggest me how to implment this.
    Thanks in advance.

    set your own UI, overriding paintTab(..) to add 5 (or whatever gap) to each of rects.x

  • How To use JFile Chooser in a Tabbed Pane Dialog

    I have created a tabbed pane dialog. In one of the tabs I want to add a JFile Chooser.
    How can I approach this problem. also Do I have to use a JDialog with a frame or can I create a JDialog without using a frame and create a instance from the main function.

    I have created a tabbed pane dialog. In one of the
    tabs I want to add a JFile Chooser. Since JFileChooser is a JComponent you could add it to any Container like any other JComponent.
    Maybe you have to do some init by hand which is done normally by the show*() methods of JFileChooser. Taking a look at the source of showDialog() should help.
    Hope that helps,
    Alex

  • Multiple Views of Same Rows from a Tabbed Pane

    I have a Tabbed Pane with several Tabs that access Different Tables. One Table is the child of two different Tables, ie one foreign key on the child that that points to Table A and a second foreign key on the child that points to Table B. I am trying to have a tabbed pane that will show the childs rows one based on the Table A Foreign Key and the second based on the Table B Foreign Key.
    No matter what I have tried, I get only one view from both Tabs. (NOTE: Both of the Tabbed pane that I instantiate from look completly different, ie a different sequence of fields.)
    I have two distinct rowsetinfo's for each tab each with it own distinct Query. I have each MasterLink pointing to the appropriate Master, either Table A or Table B and it doesn't work.
    I have tried to create additional Business components for the second view, but don't know how to link the rowset to the appropriate Business Component, if that's the problem.
    Any help or suggestion would be greatly appreciated, because I'm Lost.

    hi
    i've tried to do that some time ago and i had to give up... unfortunately i think java3D can't use various rendering modes for the same universe
    regards
    GnG

  • Make a component invisible after all tabs in a tabbed pane are closed

    Hi,
    I am using a tabbed pane and open images in tabs. I want to disable a comonent after i find all the tabs of the tabbed pane closed and when all the tabs are closed the tab pane should also be closed.
    Please help me.

        TabPane tabPane = new TabPane();
        tabPane.getTabs().addListener(new ListChangeListener<Tab>() {
          @Override
          public void onChanged(
              javafx.collections.ListChangeListener.Change<? extends Tab> c) {
            if (tabPane.getTabs().isEmpty()) {
             // whatever you need here:
             // somePane.getChildren().remove(tabPane);
             // someControl.setDisable(true);
        });

Maybe you are looking for