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.");
}

Similar Messages

  • 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

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

  • Help w/tabbed pane -- URGENT!

    i'm developing a program that will open up documents and put them in a tabbed pane. One thing that i have learned is that setting the text of a component inside of a tabbed pane is easier than getting the text back from it when the user goes to save.
    public void addDoc(String text, String title, String toolTipTab) {
    textArea = new JTextArea();
    textArea.setTabSize(2);
    textArea.setText(text);
    JScrollPane scrollPane = new JScrollPane(textArea);
    tabbedPane.addTab(title, scrollPane);
    tabbedPane.setSelectedComponent(scrollPane);
    what i would like to do is to get the text from the JTextArea() and save it. I have tried the follwoing
    tabbedPane.getSelectedComponent().textArea.getText();
    but that doesn't work. Also just using textArea.getText(); doesn't work because it will only get the newly opened document. Also if i can solve this, then i can implement Cut Copy Paste and Select All
    thanks

    i'm developing a program that will open up documents
    and put them in a tabbed pane. One thing that i have
    learned is that setting the text of a component inside
    of a tabbed pane is easier than getting the text back
    from it when the user goes to save.
    public void addDoc(String text, String title, String
    toolTipTab) {
    textArea = new JTextArea();
    textArea.setTabSize(2);
    textArea.setText(text);
    JScrollPane scrollPane = new JScrollPane(textArea);
    tabbedPane.addTab(title, scrollPane);
    tabbedPane.setSelectedComponent(scrollPane);
    what i would like to do is to get the text from the
    JTextArea() and save it. I have tried the follwoing
    tabbedPane.getSelectedComponent().textArea.getText();
    but that doesn't work. Also just using
    textArea.getText(); doesn't work because it will only
    get the newly opened document. Also if i can solve
    this, then i can implement Cut Copy Paste and Select
    All
    thanksWhy not keep one copy of the text area in class scope, so for example:
    public class MyClass {
    private JTextArea textArea = null;
      public void addDoc(String text, String title, String
      toolTipTab) {
      textArea = new JTextArea();
      textArea.setTabSize(2);
      textArea.setText(text);
      JScrollPane scrollPane = new JScrollPane(textArea);
      tabbedPane.addTab(title, scrollPane);
      tabbedPane.setSelectedComponent(scrollPane);
      public String getText() throws BadLocationException {
       return textArea.getDocument().getText(0,textArea.getDocument().getLength());
    }Am I understanding your problem correctly?
    I think this should return what you need.
    Dan Hughes

  • Office Web Apps Server 2013 - Word Web App - Problem with Tab space

    Hello We have Office Web Apps Server 2013 running with SharePoint 2013.  Users Editing a Word document with Office Web Apps, can't use "Tabs", any Word document with Tabs; the tabs are replaced with a single space.
    Has anyone noticed this?  Is this a bug?
    -thanks
    thomas
    -Tom

    Yes, currently the Word Web App does not support
    Tab Keyboard shortcut for editing document content .
    For more information, you can have a look at
    the article:
    http://office.microsoft.com/en-us/office-online-help/keyboard-shortcuts-in-word-online-HA010378332.aspx?CTT=5&origin=HA010380212
    http://social.technet.microsoft.com/Forums/en-US/3f5978d3-67a1-4c8c-981f-32493d72610b/office-web-apps-server-2013-word-web-app-problem-with-tab-space?forum=sharepointgeneral

Maybe you are looking for

  • Reader 9.3 MUI ACW-built package causes client to stop receiving add'l advertisements

    Send out an Adobe Reader 9.3 Advertisement via Microsoft's SCCM - And after it successfully installed, no successive advertisements will ever be received by that client. I posted some details of this case in the Native Mode forum, but I've since narr

  • Unable to attach file

    Hi, When i excute procedure which sends mail with word attachment,tha following error message is displayed. kindly help me . procedure code is as fallows CREATE or replace PROCEDURE pro_MAIL_ATTACH_tolldoc IS vInHandle utl_file.file_type; rfile RAW(3

  • ASO cube - dimension order

    Hello All, Is there any optimal way to ararnge dimensions in an ASO cube? I have a couple of dimensions specified as 'Dynamic' while remaining dimensions as stored. Please direct me to documentation(, if any), if possible. Thank you.

  • Scaling buttons with text

    Hello, I work with the brand new fireworks CS6. I would like to make a simple navigation with 5 buttons. But there is a big problem with the scaling of text. Even if i place buttons of the standard library i can't scale correct !!!! After scaling the

  • Restricting the Query Design Mode Toolbar in BEx

    Hello, Query Design Mode toolbar is available to Citrix users when using the BEx Analyser. THe client would like this switched off in the workbooks so users cannot see the make-up of the query.  Does anyone one know who to carry this out? Thanks, Hem