Tabbed Pane Problem

Im working on a program that keeps track of the progress and budget of different projects. Each project is given its own tab. I am already at the point where i can create and delete tabs using ActionListeners. What i need to be able to do is to have the same JLabels show differnt data, eg. the projects budget, on each tab. Right now when i click the button to change the JLabel to display the projects budget, it will change it on the tab i am on if only one tab is open. If more than one tab is open, it will only change the JLabel on the last tab to be created no matter which tab i press the button on.
Each tab has 12 panels on it, one for each month. And each of the 12 panels has it own edit button. I need to be able to edit each individual label on each of the 12 panels without affecting the panels of the other tabs.
I cant have multiple JLabels because there is no way for me to know how many projects will be created and deleted.
Is there any way for me to have the edit button's ActionListener distinguish between which of the 12 panels, and which of the tabs i am using?
Thanks,
Ross

Thanks for the tip. Heres my code
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class ForumEx
  JTabbedPane tab;
  JMenuBar menuBar;
  JMenu menu;
  JMenuItem menuItem;
  JFrame frame;
  JPanel mainPanel;
  JLabel originalText;
  JLabel label;
  JTextField nameInput;
  String projectName;
  public static void main(String[] args)
    ForumEx ar = new ForumEx();
  public ForumEx()
    JFrame frame = new JFrame("");
    tab = new JTabbedPane();
    //frame.add(tab, BorderLayout.CENTER);
    mainPanel = new JPanel();
    JPanel panel = new JPanel();
    tab.add("Example Project 1", panel);
    frame.add(tab);
    menuBar = new JMenuBar();
    menu = new JMenu("Projects");
    menu.setFont(new Font("Arial Unicode MS", Font.BOLD, 13));
    menuBar.add(menu);
    menuItem = new JMenuItem("   New Project      ");
    menuItem.setFont(new Font("Arial Unicode MS", Font.PLAIN, 13));
    menuItem.addActionListener(new AddProject());
    KeyStroke ctrlNKeyStroke = KeyStroke.getKeyStroke("control N");
    menuItem.setAccelerator(ctrlNKeyStroke);
    menu.add(menuItem);
    mainPanel.add(menuBar);
    frame.add(mainPanel, BorderLayout.NORTH);
    frame.setSize(400, 400);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  public class AddProject implements ActionListener
    public void actionPerformed(ActionEvent e)
          frame = new JFrame("New Project");
          JPanel mainPanel = new JPanel(new GridLayout(1,2));
          JPanel buttonPanel = new JPanel();
          JButton create = new JButton("Create");
          create.setFont(new Font("Arial Unicode MS", Font.BOLD, 13));
          JRootPane rootPane = frame.getRootPane();
          rootPane.setDefaultButton(create);
          create.addActionListener(new Create());
          buttonPanel.add(create);
          label = new JLabel("Project Name:     ");
          label.setFont(new Font("Arial Unicode MS", Font.PLAIN, 13));
          mainPanel.add(label);
          nameInput = new JTextField(15);
          mainPanel.add(nameInput);
          mainPanel.add(buttonPanel);
          frame.add(mainPanel);        
          frame.pack();
          frame.setVisible(true);
  public class Create implements ActionListener
    public void actionPerformed(ActionEvent e)
          if(tab.getTabCount() == 0)
                mainPanel.add(tab);
          String empty = "";
          projectName = nameInput.getText();
          JButton changeText = new JButton("Change Text");
          changeText.addActionListener(new ChangeText());
          JPanel panel2 = new JPanel(new GridLayout(2,1));
          originalText = new JLabel("Original Text");
          panel2.add(originalText);
          panel2.add(changeText);
          tab.add("  " + projectName + "  ", panel2);
          tab.setFont(new Font("Arial Unicode MS", Font.PLAIN | Font.ITALIC, 13));
          frame.setVisible(false);
          frame.dispose();
  public class ChangeText implements ActionListener
    public void actionPerformed(ActionEvent e)
          originalText.setText("NEW TEXT");
}maybe now i can better explain my problem. When you run this, click "Projects", name the project "1" and click create. Now if you click the change text button, the label will change to what i set. Click projects again, name this one "2". Click the button. Again the label changes without affecting the first one. But heres where the problem is, create two more tabs named "3" and "4". Now on tab 3, click the change text button. The label on that page wont change, but if you go to tab "4" the label will be changed. I know that the button is only affecting the most recently created label.
Again, what im looking to do is to be able to have each button only affect the label of its own panel). And much later in this project there will be a ActionListener that will get what the label says, but i need it to be able to get the text of the label of the tab that i am on, not just the most recently created.
Thanks again,
Ross

Similar Messages

  • Problem in tabbed panes

    hai friends,
    i am trying to create a tabbed pane which contains 3 panes.(top)
    and i try to add a tabbed pane at bottom of first pane which is a panel.
    i have set the size of panel as panel.setPreferredSize(new Dimension(750, 475));
    Now i am finding i cannot view the tabbed panes added to the panel.
    the relevant code is given below.
    some one have any idea..
    panel.add(new JScrollPane(textArea));
    panel.add(new JScrollPane(table));
    panel.setPreferredSize(new Dimension(750, 475));
    panel.setBackground(Color.PINK);
    JTabbedPane tabbedPane2 = new JTabbedPane     (JTabbedPane.BOTTOM);
    tabbedPane2.add("Result",new JTable(10,10));
    tabbedPane2.add("Message",new JTextArea());
    panel.add(tabbedPane2);
    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.addTab("name1", new JScrollPane(panel));
    tabbedPane.addTab("name2",
         new JScrollPane(new JTextArea(5, 5)));
    tabbedPane.addTab("ANALYSIS", new JButton("<   HAI ALL   >"));
    container.add(tabbedPane);
    tabbedPane.setBackground(Color.ORANGE);

    i am giving the code i have done for the development of schema browser.
    i have some what overcome the problem i have faced. but i know its not a proper way.
    i am not able to use other layouts successfully to arrange these components.The layout now i have is not good enough.
    may be because i am beginner.
    kindly give your comments.....
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTable;
    import javax.swing.JTextArea;
    import javax.swing.border.BevelBorder;
    public class Trial1 extends JFrame implements ActionListener {
         Container container = null;
         private JTextArea textArea;
         private JTextArea result = new JTextArea();
         private JButton connection;
         private JButton execute;
         private ResultSet rs;
         private Connection con;
         public Trial1(String title) {
              super(title);
              container = this.getContentPane();
              container.setBackground(Color.BLACK);
              menu();
              panes();
              makeConnection();
              container.setLayout(new FlowLayout());
              this.setSize(800, 575);
              show();
         void menu() {
              JMenuBar menuBar = new JMenuBar();
              container.add(menuBar, FlowLayout.LEFT);
              menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
              menuBar.setForeground(Color.blue);
              JMenu file = new JMenu("File");
              JMenu edit = new JMenu("Edit");
              JMenu query = new JMenu("Query");
              menuBar.add(file);
              menuBar.add(edit);
              menuBar.add(query);
              file.add(new JMenuItem("New"));
              file.add(new JMenuItem("Open"));
              file.add(new JMenuItem("Save"));
              file.add(new JMenuItem("Save As"));
              file.addSeparator();
              file.add(new JMenuItem("Exit"));
              edit.add(new JMenuItem("Undo"));
              edit.addSeparator();
              edit.add(new JMenuItem("Cut"));
              edit.add(new JMenuItem("Copy"));
              edit.add(new JMenuItem("Paste"));
              edit.addSeparator();
              edit.add(new JMenuItem("Delete"));
              edit.add(new JMenuItem("Select All"));
              query.add(new JMenuItem("Compile"));
              query.add(new JMenuItem("Run"));
              query.add(new JMenuItem("Execute"));
              setJMenuBar(menuBar);
         void panes() {
              JPanel panel = new JPanel();
              textArea = new JTextArea(4, 50);
              textArea.setBorder(BorderFactory.createLineBorder(Color.black));
              JTabbedPane tabbedPane2 = new JTabbedPane(JTabbedPane.BOTTOM);
              JTable table = new JTable(5,10);
              tabbedPane2.add("Result",table);
              table.setBorder(BorderFactory.createLineBorder(Color.black));
              tabbedPane2.add("Message",result);
              tabbedPane2.setPreferredSize(new Dimension(750, 350));
              tabbedPane2.setBackground(Color.ORANGE);
              connection = new JButton("Connection");
              panel.add(connection);
              execute = new JButton("    Execute       ");
              execute.addActionListener(this);
              panel.add(execute);
              panel.add(new JScrollPane(textArea));
              panel.add(tabbedPane2);
              //panel.add(new JScrollPane(table));
              panel.setPreferredSize(new Dimension(750, 475));
              panel.setBackground(Color.PINK);
              //panel.setLayout(new GridLayout(2,3));
              JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
              tabbedPane.addTab("QUERY", new JScrollPane(panel));
              tabbedPane.addTab("SCHEMA BROWSER",
                        new JScrollPane(new JTextArea(5, 5)));
              tabbedPane.addTab("ANALYSIS", new JButton("<   HAI ALL   >"));
              container.add(tabbedPane);
              tabbedPane.setBackground(Color.ORANGE);
         public void actionPerformed(ActionEvent e) {
              Object src = e.getSource();
              /* myArea.getDocument().addDocumentListener( */
              if (src == execute) {
                   String query = textArea.getText();
                   try {
                        Statement smt;
                        smt = null;
                        smt = con.createStatement();
                        rs = smt.executeQuery(query);
                        while (rs.next()) {
                             result.append(rs.getString(1) + "\t" + rs.getInt(2)
                                       + "\n");
                        smt.close();
                   } catch (Exception ae) {
                        ae.printStackTrace();
         void makeConnection() {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con = DriverManager.getConnection("jdbc:odbc:jmc", "sa", "sprint");
                   //con.close();
                   System.out.println("Connection successfully estabilished.");
              } catch (Exception ae) {
                   ae.printStackTrace();
         public static void main(String arg[]) {
              Trial1 trial = new Trial1(
                        "trials.");
    }

  • Problems on tabbed pane

    Hi
    I want to design Top navigation using tabbed pane. I designed tabbed pane using <rich:tabPanel> and <rich:tab>.this page is common for all the pages. so i want to add some body while adding to another pages.if i am giving body it will display outside the body of rich tabpanel. i want to display my body information if no tabs are selected if i selected any tab tab information also display in the same place....how can i do that...
    Thanks in Advance
    mohan.

    use any plain text or html inside <f:verbatim> it will display under the pane.
    Please use ths following forum for the richfaces related questions:
    http://www.jboss.com/index.html?module=bb&op=viewforum&f=261
    Message was edited by:
    KrishnaS

  • 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 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

  • Split Pane Problem

    I have a panel with a split pane in it. On the Left hand side there is a Tree and on the right side is a complex tabbed pane.
    (complex meand it includes many panels, more tabbed panes and other components).
    My problem is this. I have given a specific width for the split pane for the tree and at start time it comes corrcetly. But when I move the Split pane left, suddenly it jumps to the left edge of the screen. And then I cant move it forward again. Tree cannot be seen now.
    Why does this happen I just cant figure out.
    Is it because of tabbed panes or something with the split pane.
    Another thing is when I try to move the split pane to the left the movements are not smooth. It kind of do smaller jumps, until it do that big jump to the edge.
    Any help would be greatly appreciated....

    Seeing that your file has a size of 3.5 Mb, I preferred not to download it, but to send you this link.

  • Form inside Tabbed Pane

    Hi, I have a JSF Tabbed Pane with 5 tabs and one of the tab's content contains a datascroller with an input text field 'Go To' where the user can enter the page number to jump to. When I hit enter after typing in a page number, it seems like it just refreshes the page (I think it processes as a Tabbed Pane 'tabchangeevent' but in fact it's not). However, after typing in a page number, and manually clicking the 'Go' button, it submits correctly (to the datascroller) and displays the correct content. Any ideas what could be the problem?

    I would try using static, compile time includes rather than runtime includes.

  • Tabbed Panes

    Dear All,
    I have to create a form with tabbed panes. How can i do this using JFC as i m new to JFC. Then i have to submit the form data in the database using JSP. Please help me to solve this.
    Some Code Please
    Thanks & Regards
    Gagan

    gaganarora77,
    This does seem a case of RTFM:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tabbedpane.html
    Please repost if you have specific problems
    --A                                                                                                                                                                                                                                                                                                                                                           

  • 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

  • Adding more rows in a html table(enclosed inside a jsf tabbed pane)

    hi,
    i m facing a problem. i have a html Table inside a jsf Tabbed Pane and a button to add more rows.whenever i click on the button it should add 5 more rows to the table using javscript.
    can anyone hlp me in solving this problem.
    thankx in advance

    Use the elegant JSF h:dataTable instead of plain HTML table with a heap of DOM stuff.

  • How to refrash tabbed pane at a run time

    hi,
    I have no practice in using tabbed panes, and now I have to solve a little problem. I am running internal frame wich contains tabbedpane. The tab which opens by default contains combobox which reads its data from DB. But when I open internal frame no data exists in a combobox.
    Since I change the tab and select back again the same tab data combobox reads its data. I tried to validate the tab but nothing changes.
    Where is my fault?

    The code that loads the data into the combo box is not being executed when you first create the internal frame. We can't tell you why since we have no idea what your code looks like.
    So, trace the order of execution to see why the code is not executing.

  • How to paste an image upper the tabbed pane

    Hello! I have a problem , i want to set the image in the following program at the top
    . Can i set the location of the tabbed pane?? and how?
    import javax.swing.JTabbedPane;
    import javax.swing.ImageIcon;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import java.awt.*;
    import java.awt.event.*;
    public class AdminPane extends JPanel {     
    public AdminPane()
    ImageIcon icon = new ImageIcon("images/green_phone.gif");
              JTabbedPane tabbedPane = new JTabbedPane();
              Component pane1 = makeTextPanel("Index Page");
    tabbedPane.addTab("Home", icon, pane1, "Index Page");
    tabbedPane.setSelectedIndex(0);
              Component pane2 = makeTextPanel("Debit Card Tables");
    tabbedPane.addTab("Debit Card System", icon, pane2, "Does twice as much nothing");
    Component pane3 = makeTextPanel("Merchant Tables");
    tabbedPane.addTab("Merchant System", icon, pane3, "Still does nothing");
    Component pane4 = makeTextPanel("Administrative Tools");
    tabbedPane.addTab("Administrative Tools", icon, pane4, "Does nothing at all");
    Component pane5 = makeTextPanel("Database Recure");
    tabbedPane.addTab("Database Recure", icon, pane5, "Does nothing at all");
              //Add the tabbed pane to this panel.
    setLayout(new GridLayout(2, 0));
              tabbedPane.setBackground(new Color(255, 255, 255));
              add(tabbedPane);
    // acquire the image
    image = Toolkit.getDefaultToolkit().getImage
    ("images/green_phone.gif");
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(image, 0);
    try { tracker.waitForID(0); }
    catch (InterruptedException exception) {}
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    g.drawImage(image, 0, 300, null);
    private Image image;
    protected Component makeTextPanel(String text)
    JPanel panel = new JPanel(false);
    JLabel filler = new JLabel(text);
    filler.setHorizontalAlignment(JLabel.CENTER);
              //panel.setBackground(new Color(255, 255, 255));
    panel.setLayout(new GridLayout(1, 1));
              panel.add(filler);
    return panel;
    public static void main(String[] args)
    JFrame frame = new JFrame("AdminPane");
    frame.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e) {System.exit(0);}
    frame.getContentPane().add(new AdminPane(),
    BorderLayout.CENTER);
    frame.setSize(500, 550);
    frame.setVisible(true);

    Image at the top? Are you talking about the application image? Try setIconImage.
    To set the location of the tabbed pane, either use setLocation(...) or use some sort of layout manager
    to set the location of the Image relative to the tabbed pane, do
    Point p = tabbedpane.getLocation();
    Image.setLocation(p.x-d,p.y-c);

  • Hiding tabbed panes-should be enabled only on certain event

    Hi,
    I desperately need help. I'm still new to swings and thus need help.I'm writing an swing application where i have tabbed panes just like a tree i.e
    main1,main2
    under main1 have have another set of tabbed panes. Now i have to enable only the first pane and inside that pane there is a button which should enable the other pane and so forth. I just cannot figure how i should go about doing it. Any help is appreciated.
    ashah

    I tried doing that the new problem that i came across is that -
    here is the sample of the code. This is on the similar lines like i have written the code
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class tabbedPaneDemo extends JPanel
    JTabbedPane tabbedPane = new JTabbedPane();
    JPanel panel1 = new JPanel();
    JPanel mainPanel1 = new JPanel();
    public tabbedPaneDemo()
    Component panel1 = makePanel1();
    tabbedPane.addTab("Panel1", panel1);
    tabbedPane.setSelectedIndex(0);
    setLayout(new GridLayout(1, 1));
    add(tabbedPane);
    Component makePanel1()
         JButton next = new JButton("Next");
         buttonListener listener = new buttonListener();
         next.addActionListener(listener);
         mainPanel1.add(next);
         return mainPanel1;
    class buttonListener implements ActionListener
         public void actionPerformed(ActionEvent e)
              if(e.getSource() == "Next")
                   tabbedPane.removeTabAt(0);
                   tabbedPane.addTab("Panel2",null,makePanel2());
                   tabbedPane.setSelectedIndex(0);
                   JButton next1 = new JButton("Next1");
                   buttonListener listener = new buttonListener();
                   next1.addActionListener(listener);
                   panel1.add(next1);
              if(e.getSource() == "Next1")
                   tabbedPane.setEnabledAt(0,false);
                   tabbedPane.addTab("Panel3",null,makePanel3());
                   tabbedPane.setSelectedIndex(1);
    Component makePanel2()
         return panel1;
    Component makePanel3()
         JPanel mainPanel = new JPanel();
         return mainPanel;
    public static void main(String args[])
         tabbedPaneDemo demo = new tabbedPaneDemo();
         JPanel p = new JPanel(new BorderLayout());
         p.add(demo,BorderLayout.NORTH);
         JFrame frame1 = new JFrame("TabbedPaneDemo");
         frame1.addWindowListener(new WindowAdapter()
         public void windowClosing(WindowEvent e)
              System.exit(0);
         frame1.getContentPane().add(p, BorderLayout.CENTER);
         frame1.setSize(400, 125);
    frame1.setVisible(true);
    I know there is a very simple mistake that i'm making but i can't figure where.

  • 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."

Maybe you are looking for

  • TDS line items are not Display in FB60

    Hi Experts, when in simulate a document in  T code- FB60. the TDS amount is calculated properly . DR , Cr is ok but the Line item of the TDS is not displayed.  when i post the document and open in FB03 all line items are dispalyed with TDS Line items

  • Use G5 iMac as external monitor/display for Intel iMac?

    I have a 24" Intel iMac and a 20" G5 iMac (which is sort of mothballed now).I was wondering if it is possible to use the older iMac as an external monitor, mainly to save the expense of buying a "proper" external display when there seems to be a perf

  • GRC-AC 5.3sp14, ERM, Role Generation

    We updated our GRC-AC 5.3 from sp12 to sp14 and now we cannot generate roles anymore. When we try to do it, we get the following error: "Failure : Field AGR_1252 not a member of TABLES". Does any one know how can we solve it? The backends were also u

  • How can I set value for vc application's form

    there is a running vc application,and the vc application has form.the form's parameters can input from keyboard.but I want use java application to realize the function that input parameter instead of mannual input. can you give me some advices,thank

  • Laptop does not start after windows 8 update

    hi every one 2 days ago my hp-15 notebook got 2 windows 8 updates. The 2nd one failed and after 1 hr i removed the battery to put it out of it's misery. now, when i push the start button only the wifi-lichts go on for about 30 sec and then the system