JTabbedPane resizing

Hi
I'm creating an application that uses a JTabbedPane and i want the panels in the tabs to have different sizes, what i want to know is that if its possible to have the JTabbedPane resize after you change the tab. Is there any way to this in the creation of the gui, or do I have to change some things in the JTabbedPane UI?
Thanks for any help.

Try using revalidate() on the JPanel that contains the tabbed pane. This should inovoke the LayoutManager and cause the components to be layout out again.

Similar Messages

  • JTabbedPane resize problem

    I have a JTabbedPane in a JPanel (BorderLayout.CENTER).
    That JPanel is the content component of a JOptionPane.
    The JOptionPane is in a JScrollPane which is in a JDialog.
    When the JDialog is resized (larger), the JTabbedPane enlarges too as desired.
    However, when the JDialog is resized (smaller), the JTabbedPane does not reduce in size consistently as one would wish.
    Any one know why, have a solution, etc.
    Any ideas appreciated.
    Thanks.

    I am using gl4java's GLAnimCanvas as the canvas based object in my application. Since
    the Swing based gl4java object is not hardware accellerated, it is way to too slow for my application
    (a 3D gui ).

  • Resize JTable in JTabbedPane

    Given the FileTableDemo from the Java Foundation Class in a Nutshell book.(O'Reilly) Chapter 3 page 51 in my addition.
    I have modified the example to place the JTable in a JTabbedPane. Now when the window (JFrame) is resized by the user the JTable no longer resizes. How do I passing the "resizing" into the component (JTable) placed in the JTabbedPane?
    Here is the code: My deviation from the example is enclosed in "///////////KBS" and of course the line frame.getContentPane().add(myTP, "Center"); where "pane" has been replaced with "myTP"
    Thanks Brad
    import javax.swing.*;
    import javax.swing.table.*;
    import java.io.File;
    import java.util.Date;
    public class FileTableDemo
    public static void main(String[] args)
    // Figure out what directory to display
    File dir;
    if (args.length > 0)
    dir = new File(args[0]);
    else
    dir = new File(System.getProperty("user.home"));
    // Create a TableModel object to represent the contents of the directory
    FileTableModel model = new FileTableModel(dir);
    // Create a JTable and tell it to display our model
    JTable table = new JTable(model);
    JScrollPane pane = new JScrollPane(table);
    pane.setBorder(BorderFactory.createEmptyBorder(60,20,20,20));
    ////////KBS
    JTabbedPane myTP = new JTabbedPane();
    JPanel myOne = new JPanel();
    JPanel myTwo = new JPanel();
    myOne.add(pane);
    myTP.add("One", myOne);
    myTP.add("Two", myTwo);
    ////////KBS
    // Display it all in a scrolling window and make the window appear
    JFrame frame = new JFrame("FileTableDemo");
    frame.getContentPane().add(myTP, "Center");
    frame.setSize(600, 400);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
    // The methods in this class allow the JTable component to get
    // and display data about the files in a specified directory.
    // It represents a table with six columns: filename, size, modification date,
    // plus three columns for flags: direcotry, readable, writable
    class FileTableModel extends AbstractTableModel
    protected File dir;
    protected String[] filenames;
    protected String[] columnNames = new String[] {
    "name",
    "size",
    "last modified",
    "directory?",
    "readable?",
    "writable?"
    protected Class[] columnClasses = new Class[] {
    String.class,
    Long.class,
    Date.class,
    Boolean.class,
    Boolean.class,
    Boolean.class
    // This table model works for any one given directory
    public FileTableModel(File dir)
    this.dir = dir;
    this.filenames = dir.list();
    // These are easy methods
    public int getColumnCount()
    return 6;
    public int getRowCount()
    return filenames.length;
    // Information about each column
    public String getColumnName(int col)
    return columnNames[col];
    public Class getColumnClass(int col)
    return columnClasses[col];
    // The method that must actually return the value of each cell
    public Object getValueAt(int row, int col)
    File f = new File(dir, filenames[row]);
    switch(col)
    case 0: return filenames[row];
    case 1: return new Long(f.length());
    case 2: return new Date(f.lastModified());
    case 3: return f.isDirectory() ? Boolean.TRUE : Boolean.FALSE;
    case 4: return f.canRead() ? Boolean.TRUE : Boolean.FALSE;
    case 5: return f.canWrite() ? Boolean.TRUE : Boolean.FALSE;
    default: return null;
    }

    Well, I didn't find an answer but I did find a solution.
    The JPanel is the problem. I use it to help with layout which is not obvious in this example.
    As you can see in the code the JTable is placed in a JScrollPane which is place in a JPanel which is placed in a JTabbedPane.
    If I use Box instead of JPanel the JTable in the JScrollPane in the Box in the TabbedPane in the JFrame resizes correclty.
    So although JPanel is resizable with setSize it does not get resized when it's JFrame gets resized.
    I would still like to know why?
    ////////KBS
    JTabbedPane myTP = new JTabbedPane();
    Box myOne = Box.createHorizontalBox();
    Box myTwo = Box.createHorizontalBox();
    myOne.add(pane);
    myTP.add("One", myOne);
    myTP.add("Two", myTwo);
    ////////KBS

  • Resize Jpanel and JtabbedPane

    Hi All,
    i implement a resize process on jpanel that include JtabbedPane inside.
    it working fine except one thing.
    when i resize my panel it work fine, until some point it start to shrink and get smaller.
    i think it getting shrink because im getting to the end of my dialog.
    i want to avoid this beheviour and let the tabbedpanel extend as much as possible:
    this is my code:
    package test;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.GraphicsConfiguration;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.HeadlessException;
    import java.awt.Point;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    import javax.swing.SwingUtilities;
    public class BaseMain extends JFrame {
         Point sp;
         int     jPanelStartHeight;
         int     jPanelStartWidth;
         int     jTabPaneStartHeight;
         int     jTabPaneStartWidth;
         Point offset;
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JPanel jPanel = null;
         private JTabbedPane jTabbedPane = null;
         private JPanel jPanel1 = null;
         private JTabbedPane jTabbedPane1 = null;
         private JPanel jPanel2 = null;
         private JTabbedPane jTabbedPane2 = null;
         public BaseMain() throws HeadlessException {
              // TODO Auto-generated constructor stub
              super();
              initialize();
         public BaseMain(GraphicsConfiguration arg0) {
              super(arg0);
              // TODO Auto-generated constructor stub
              initialize();
         public BaseMain(String arg0) throws HeadlessException {
              super(arg0);
              // TODO Auto-generated constructor stub
              initialize();
         public BaseMain(String arg0, GraphicsConfiguration arg1) {
              super(arg0, arg1);
              // TODO Auto-generated constructor stub
              initialize();
          * This method initializes jPanel     
          * @return javax.swing.JPanel     
         private JPanel getJPanel() {
              if (jPanel == null) {
                   GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
                   gridBagConstraints1.fill = GridBagConstraints.BOTH;
                   gridBagConstraints1.weighty = 1.0;
                   gridBagConstraints1.weightx = 1.0;
                   gridBagConstraints1.gridheight=3;
                   jPanel = new JPanel();
                   jPanel.setLayout(new BorderLayout());
                   jPanel.setBorder(BorderFactory.createLineBorder(Color.black, 2));
                   jPanel.add(getJTabbedPane(),BorderLayout.SOUTH/* gridBagConstraints1*/);
                   jPanel.addMouseListener(new java.awt.event.MouseAdapter() {
                        public void mousePressed(java.awt.event.MouseEvent e) {
                             System.out.println("mousePressed()"); // TODO Auto-generated Event stub mousePressed()
                             //original size
                             jPanelStartHeight = jPanel.getHeight();
                             jPanelStartWidth  = jPanel.getWidth();
                             jTabPaneStartHeight = jTabbedPane.getHeight();
                             jTabPaneStartWidth  = jTabbedPane.getWidth();
                              offset = SwingUtilities.convertPoint(e.getComponent(),e.getPoint(),jPanel);
                   jPanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
                        public void mouseDragged(java.awt.event.MouseEvent e) {
                             System.out.println("mouseDragged()"); // TODO Auto-generated Event stub mouseDragged()
                             Point p = SwingUtilities.convertPoint(e.getComponent(),e.getPoint(), jContentPane);
                             jPanel.setSize(jPanelStartWidth,p.y+jPanelStartHeight);
                             jTabbedPane.setSize(jTabPaneStartWidth,p.y+jTabPaneStartHeight);
                             jPanel.setLocation(0/*p.x-offset.x*/,p.y-offset.y);
              return jPanel;
          * This method initializes jTabbedPane     
          * @return javax.swing.JTabbedPane     
         private JTabbedPane getJTabbedPane() {
              if (jTabbedPane == null) {
                   jTabbedPane = new JTabbedPane();
                   jTabbedPane.addTab(null, null, getJPanel1(), null);
                   jTabbedPane.addTab(null, null, getJPanel2(), null);
              return jTabbedPane;
          * This method initializes jPanel1     
          * @return javax.swing.JPanel     
         private JPanel getJPanel1() {
              if (jPanel1 == null) {
                   GridBagConstraints gridBagConstraints = new GridBagConstraints();
                   gridBagConstraints.fill = GridBagConstraints.BOTH;
                   gridBagConstraints.weighty = 1.0;
                   gridBagConstraints.weightx = 1.0;
                   jPanel1 = new JPanel();
                   jPanel1.setLayout(new GridBagLayout());
                   jPanel1.add(getJTabbedPane1(), gridBagConstraints);
              return jPanel1;
          * This method initializes jTabbedPane1     
          * @return javax.swing.JTabbedPane     
         private JTabbedPane getJTabbedPane1() {
              if (jTabbedPane1 == null) {
                   jTabbedPane1 = new JTabbedPane();
              return jTabbedPane1;
          * This method initializes jPanel2     
          * @return javax.swing.JPanel     
         private JPanel getJPanel2() {
              if (jPanel2 == null) {
                   GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
                   gridBagConstraints2.fill = GridBagConstraints.BOTH;
                   gridBagConstraints2.weighty = 1.0;
                   gridBagConstraints2.weightx = 1.0;
                   jPanel2 = new JPanel();
                   jPanel2.setLayout(new GridBagLayout());
                   jPanel2.add(getJTabbedPane2(), gridBagConstraints2);
              return jPanel2;
          * This method initializes jTabbedPane2     
          * @return javax.swing.JTabbedPane     
         private JTabbedPane getJTabbedPane2() {
              if (jTabbedPane2 == null) {
                   jTabbedPane2 = new JTabbedPane();
              return jTabbedPane2;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        BaseMain thisClass = new BaseMain();
                        thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        thisClass.setVisible(true);
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(new BorderLayout());
                   jContentPane.add(getJPanel(), BorderLayout.SOUTH);
              return jContentPane;
    }

    hey gabi,
    i tried your code and it works just fine.... there is no shrinking or any resizing problem?! i don't know... maybe i just don't get it? so maybe u could describe your problem a little more?!
    :)

  • JFrame.pack() causes problems with jtabbedpane(making new tabs)and resizing

    I have a JFrame with a JTabbedPane inside of it. Inside of each tab I put a JPanel with a JTextArea in it. When I create a new tab, I do something like textArea.requestFocusInWindow();
    However, this will not work unless I do a frame.pack() right after I created the new tab and right before that line of code.
    This in turn causes another problem. If I resize the jframe and then create a new tab, the window will snap back to the size it had before creating the tab. I assume this has to do with the pack() function, however nothing else I try will make the cursor blink in the JTextArea.
    Is there a solution to this...either something to make the cursor blink or something other than the pack function to update the JFrame?
    Thank you

    This posting should help you out:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=581478

  • Unable to resize JtabbedPane..plz help

    I am sorry for asking a silly question!!.. but still because am new to java. I am using Netbeans.When i maximize the Window... JtabbedPane gets Resize in a weird Manner.i want every component to get resized Proportionately.Here r the screen shots...
    1. In normal from :
    http://picasaweb.google.com/flyankur/ZhaatProbs/photo#5140928287175741826
    2. When i maximize it :
    http://picasaweb.google.com/flyankur/ZhaatProbs/photo#5140928291470709138
    You can see in the second snap shot. The Tab maximizes in an unusual manner.. its components do not grow /get enlarged with window maximization!!
    Now how do i make it all get enlarged proportionally!!???

    I was going to help until I notice that you have cross-posted and multi-posted this question in 3 different forums.
    http://forum.java.sun.com/thread.jspa?threadID=5244195
    http://forum.java.sun.com/thread.jspa?threadID=5244193
    http://forum.java.sun.com/thread.jspa?threadID=5244172
    http://forum.java.sun.com/thread.jspa?threadID=5244171
    http://forum.java.sun.com/thread.jspa?threadID=5244170
    This is not the first time you have done this either. The last time you posted the question 6 times.
    Learn the proper ettiquette of using a forum. Until you do, nobody is going to help you.

  • JTabbedPane, switch of auto resizing of the tab header possible?

    Hi,
    Is it possible to prevent the tab header from auto resizing?
    In this code the tab "Page 1" fills the whole row at start up, but I would like to prevent it from taking more space than needed.
    import java.awt.*;
    import javax.swing.*;
    class TabbedPaneExample
            extends     JFrame
        private        JTabbedPane tabbedPane;
        private        JPanel        panel1;
        private        JPanel        panel2;
        private        JPanel        panel3;
        public TabbedPaneExample()
            // NOTE: to reduce the amount of code in this example, it uses
            // panels with a NULL layout.  This is NOT suitable for
            // production code since it may not display correctly for
            // a look-and-feel.
            setTitle( "Tabbed Pane Application" );
            setSize( 140, 200 );
            setBackground( Color.gray );
            JPanel topPanel = new JPanel();
            topPanel.setLayout( new BorderLayout() );
            getContentPane().add( topPanel );
            // Create the tab pages
            createPage1();
            createPage2();
            createPage3();
            // Create a tabbed pane
            tabbedPane = new JTabbedPane();
            tabbedPane.addTab( "Page 1", panel1 );
            tabbedPane.addTab( "Page 2", panel2 );
            tabbedPane.addTab( "Page 3", panel3 );
            topPanel.add( tabbedPane, BorderLayout.CENTER );
        public void createPage1()
            panel1 = new JPanel();
            panel1.setLayout( null );
        public void createPage2()
            panel2 = new JPanel();
            panel2.setLayout( new BorderLayout() );
        public void createPage3()
            panel3 = new JPanel();
            panel3.setLayout( new GridLayout( 3, 2 ) );
        // Main method to get things started
        public static void main( String[] args )
            // Create an instance of the test application
            TabbedPaneExample mainFrame    = new TabbedPaneExample();
            mainFrame.setVisible( true );
    }Edited by: user6102378 on 2010-okt-07 06:51

    Unfortunately, the answer seems to be "no" - looks like the exact behaviour is even different across different LAFs. Nothing short of re-writing the layout code in the xxTabbedPaneUI will help.
    Just curious: how comes that we have so many tabbedPane related questions recently?
    Cheers
    Jeanette

  • JSplitPane JTabbedPane Canvas resize problem

    I am using a JSplitPane to separate a tree and a JTabbedPane containing java.awt.Canvas based objects.
    I have not been able to find a way to resize the split plane over the tabbed pane. I pretty sure this
    is because the Canvas is heavyweight and the split pane lightweight, but I cannot swap out the canvas
    for a JPanel (or other swing equivalent) due to performance requirements. Is there a way to allow the
    split pane to resize over the heavyweight object?
    Below is a code snippet which illustrates what I'm trying to do. Any help would be greatly appreciated.
    Thanks!
    import javax.swing.*;
    import java.awt.*;
    public class TabTest
    public static void main(String args[])
    JFrame f = new JFrame("TabTest");
    f.setSize(800,800);
    JTree left = new JTree();
    JTabbedPane right = new JTabbedPane();
    Canvas canvas = new Canvas();
    right.add("Canvas", canvas);
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
    f.getContentPane().add(splitPane);
    f.show();
    }

    I am using gl4java's GLAnimCanvas as the canvas based object in my application. Since
    the Swing based gl4java object is not hardware accellerated, it is way to too slow for my application
    (a 3D gui ).

  • Auto resizing of Jtabbedpane

    I am using Netbeans.When i maximize the Window... JtabbedPane gets Resize in a weird Manner.i want every component to get resized Proportionately.Here r the screen shots...
    1. In normal from :
    http://picasaweb.google.com/flyankur/ZhaatProbs/photo#5140928287175741826
    2. When i maximize it :
    http://picasaweb.google.com/flyankur/ZhaatProbs/photo#5140928291470709138
    You can see in the second snap shot. The Tab maximizes in an unusual manner.. its components do not grow /get enlarged with window maximization!!
    Now how do i make it all get enlarged proportionally!!???
    This topic has no replies.

    I was going to help until I notice that you have cross-posted and multi-posted this question in 3 different forums.
    http://forum.java.sun.com/thread.jspa?threadID=5244195
    http://forum.java.sun.com/thread.jspa?threadID=5244193
    http://forum.java.sun.com/thread.jspa?threadID=5244172
    http://forum.java.sun.com/thread.jspa?threadID=5244171
    http://forum.java.sun.com/thread.jspa?threadID=5244170
    This is not the first time you have done this either. The last time you posted the question 6 times.
    Learn the proper ettiquette of using a forum. Until you do, nobody is going to help you.

  • JTabbedPane - How do I stop it from resizing?

    I am resizing a jTabbedPane. Problem is, when a tab is selected, jTabbedPane revalidates and repaints, causing it (and any other controls inside its container that were resized, moved) to go back to the original size; is there any way around this? why is it going back to its ORIGINAL size, eons after its been resized? I know how much SWING loves to be in control of the layout, but pllleeeeeeeeeaaaaaseeeeeeeee...
    ps: i am using the XYLayout manager, but this behaviour is evident in all layout managers..

    are you doing something squirrely with the layout? you are absolutely correct that Swing is obnoxious about resizing things after the fact. have you tried taking the components in the JTabbedPane and dropping them in a JPanel in a JFrame and resizing them from there? (i.e.: test that your layout mechanism is correct.)
    something else that might help is to use the setPreferredSize(), setMaximumSize() and setMinimumSize() methods.
    i recently laid out some JButtons with ImageIcons in them that were fixed 24x24 pixels. when i put them in a GridBagLayout, they were fine until i started resizing the parent JFrame. calling just the setPreferredSize() method was not enough to solve the problem, despite the fact that Swing often ignores the other setXXXSize methods. if you have static size components, this may do the trick.
    if that doesn't help, post the code.
    good luck,
    jon/hackerx

  • Auto-resize the components of JTabbedPane with JPanels

    Hi,
    We have swing window with tabbed pane having two JPanels. There are couple of components (button/text
    fields/JXTable/Jtree ..etc)added to each panel. so far, every thing is working fine.
    Issue is, when we try to expand the winodw size, the components of each panel are static. The size of components
    are not changing accorning to window size. All the components are center alligned with increasing the window size. It would be great help, if you can help on this.
    Following is the sample code used to prepare  swing window.
    public class SOS extends JFrame implements TreeWillExpandListener,
                                               TreeExpansionListener,
        JPanel firstPanel = new JPanel(new GridBagLayout());
        JPanel secondPanel = new JPanel(new GridBagLayout());
        public SOS() throws SQLException, ParserConfigurationException,
                            SAXException, IOException, XPathExpressionException {
            //EHDD Tabbed Pane
            nehObjectTypelist = new JList((createObjectsListData()).toArray());
            nehObjectTypelist.setFont(font);
            nehObjectTypelist.setCellRenderer(new CheckListRenderer());
            nehObjectTypelist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            nehObjectTypelist.setBorder(new EmptyBorder(0, 4, 0, 0));
            nehObjectTypelist.addMouseListener(new MouseAdapter() {
            JScrollPane nehObjTypeSP = new JScrollPane(nehObjectTypelist);
            nehObjTypeSP.setSize(200, 200);
            nehOwmerslist = new JList((createOwnersListData()).toArray());
            nehOwmerslist.setFont(font);
            nehOwmerslist.setCellRenderer(new CheckListRenderer());
            nehOwmerslist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            nehOwmerslist.setBorder(new EmptyBorder(0, 4, 0, 0));
            nehOwmerslist.addMouseListener(new MouseAdapter() {
            JScrollPane sp = new JScrollPane(nehOwmerslist);
            sp.setSize(200, 200);
            //JTree with checkbox
            DefaultMutableTreeNode root = createFirstLevel();
            final DefaultTreeModel model = new DefaultTreeModel(root);
            nehTree = new JTree(root);
            QuestionCellRenderer renderer = new QuestionCellRenderer();
            nehTree.setCellRenderer(renderer);
            QuestionCellEditor editor = new QuestionCellEditor();
            nehTree.setCellEditor(editor);
            nehTree.setEditable(true);
            nehTree.addTreeWillExpandListener(this);
            nehTree.setShowsRootHandles(true);
            nehTree.setModel(model);
            nehTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
            JScrollPane scroll = new JScrollPane(nehTree);
            scroll.setPreferredSize(new Dimension(200, 180));
            scroll.setFont(font);
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(1, 1, 1, 1);
            gbc.gridx = 0;
            gbc.gridy = 0;
            //gbc.gridwidth = 2;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            //gbc.anchor = GridBagConstraints.LINE_START;
            JLabel nehHeading =
                new JLabel("Select your criteria and click the Fetch Topics by Criteria button");
            nehHeading.setFont(font);
            firstPanel.add(nehHeading, gbc);
            gbc.insets = new Insets(1, 1, 1, 1);
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridx = 0;
            gbc.gridy = 1;
            gbc.gridwidth = 1;
            JLabel nehDocType = new JLabel("Type");
            nehDocType.setFont(font);
            firstPanel.add(nehDocType, gbc);
            gbc.gridx = 1;
            gbc.gridy = 1;
            JLabel nehDocOwner = new JLabel("Owner");
            nehDocOwner.setFont(font);
            firstPanel.add(nehDocOwner, gbc);
            gbc.gridx = 2;
            gbc.gridy = 1;
            JLabel nehProdTree = new JLabel("Tree");
            nehProdTree.setFont(font);
            firstPanel.add(nehProdTree, gbc);
            gbc.weightx = 0;
            gbc.weighty = 0;
            gbc.gridx = 0;
            gbc.gridy = 2;
            firstPanel.add(nehObjTypeSP, gbc);
            gbc.gridx = 1;
            gbc.gridy = 2;
            firstPanel.add(sp, gbc);
            gbc.gridx = 2;
            gbc.gridy = 2;
            firstPanel.add(scroll, gbc);
            gbc.fill = GridBagConstraints.VERTICAL;
            gbc.anchor = GridBagConstraints.FIRST_LINE_START;
            gbc.weightx = 0;
            gbc.weighty = 0;
            gbc.gridheight = 1;
            gbc.gridheight = 1;
            gbc.gridx = 0;
            gbc.gridy = 21;
            JButton fetchButton = new JButton("Fetch");
            fetchButton.setFont(font);
            fetchButton.setSize(new Dimension(175, 35));
            firstPanel.add(fetchButton, gbc);
            fetchButton.addActionListener(new ActionListener() {
            gbc.gridx = 0;
            gbc.gridy = 22;
            JLabel nehOR = new JLabel("- OR -");
            nehOR.setFont(font);
            firstPanel.add(nehOR, gbc);
            JButton searchButton = new JButton("Fetch by Title");
            searchButton.setToolTipText("Enter title search criteria");
            searchButton.setFont(font);
            gbc.gridheight = 1;
            gbc.gridx = 0;
            gbc.gridy = 23;
            gbc.anchor = GridBagConstraints.LINE_START;
            JLabel nehOpenBySVNIdLabel = new JLabel("Open by ID");
            nehOpenBySVNIdLabel.setFont(font);
            firstPanel.add(nehOpenBySVNIdLabel, gbc);
            gbc.gridheight = 1;
            gbc.gridx = 1;
            gbc.gridy = 23;
            gbc.anchor = GridBagConstraints.WEST;
            findTextField.setColumns(20);
            firstPanel.add(findTextField, gbc);
            gbc.gridheight = 1;
            gbc.gridx = 2;
            gbc.gridy = 23;
            gbc.anchor = GridBagConstraints.WEST;
            JButton openButton = new JButton("Open");
            openButton.setFont(font);
            openButton.setPreferredSize(searchButton.getPreferredSize());
            System.out.println("Button Size" + openButton.getSize());
            firstPanel.add(openButton, gbc);
            openButton.addActionListener(new ActionListener() {
            gbc.gridheight = 1;
            gbc.gridx = 0;
            gbc.gridy = 24;
            gbc.anchor = GridBagConstraints.LINE_START;
            JLabel searchLabel =
                new JLabel("Search the repository by title word(s)");
            searchLabel.setToolTipText("Enter title search criteria");
            searchLabel.setFont(font);
            firstPanel.add(searchLabel, gbc);
            gbc.gridheight = 1;
            gbc.gridx = 1;
            gbc.gridy = 24;
            gbc.anchor = GridBagConstraints.WEST;
            searchTextField = new JTextField("", 20);
            searchTextField.setColumns(20);
            searchTextField.setEditable(true);
            firstPanel.add(searchTextField, gbc);
            gbc.gridheight = 1;
            gbc.gridx = 2;
            gbc.gridy = 24;
            gbc.anchor = GridBagConstraints.WEST;
            firstPanel.add(searchButton, gbc);
            searchButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
            gbc.anchor = GridBagConstraints.FIRST_LINE_START;
            gbc.gridwidth = 4;
            gbc.gridx = 0;
            gbc.gridy = 28;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            tableScrollPane.setPreferredSize(new Dimension(200, 200));
            firstPanel.add(tableScrollPane, gbc);
            gbc.fill = GridBagConstraints.NONE;
            gbc.gridheight = 1;
            JRadioButton reviewButton = new JRadioButton("Review");
            reviewButton.setFont(font);
            reviewButton.setMnemonic(KeyEvent.VK_B);
            reviewButton.setSelected(true);
            JRadioButton testButton = new JRadioButton("Test");
            testButton.setFont(font);
            testButton.setMnemonic(KeyEvent.VK_B);
            JRadioButton prodButton = new JRadioButton("Production");
            prodButton.setFont(font);
            prodButton.setMnemonic(KeyEvent.VK_B);
            nehGroup.add(reviewButton);
            nehGroup.add(testButton);
            nehGroup.add(prodButton);
            gbc.gridx = 2;
            gbc.gridy = 30;
            firstPanel.add(reviewButton, gbc);
            gbc.gridx = 2;
            gbc.gridy = 31;
            firstPanel.add(testButton, gbc);
            gbc.gridx = 2;
            gbc.gridy = 32;
            firstPanel.add(prodButton, gbc);
            gbc.gridx = 2;
            gbc.gridy = 33;
            JButton printButton = new JButton("Print");
            printButton.setFont(font);
            firstPanel.add(printButton, gbc);
            printButton.addActionListener(new ActionListener() {
            gbc.fill = GridBagConstraints.NORTHEAST;
            gbc.gridx = 0;
            gbc.gridy = 30;
            JButton openTopicsButton = new JButton("Open Selection");
            openTopicsButton.setFont(font);
            firstPanel.add(openTopicsButton, gbc);
            openTopicsButton.addActionListener(new ActionListener() {
            gbc.gridx = 0;
            gbc.gridy = 32;
            JButton mapLinks = new JButton("Insert");
            mapLinks.setFont(font);
            JButton relatedLinks = new JButton("Insert Links");
            relatedLinks.setFont(font);
            relatedLinks.setPreferredSize(mapLinks.getPreferredSize());
            firstPanel.add(relatedLinks, gbc);
            relatedLinks.addActionListener(new ActionListener() {
            gbc.gridx = 0;
            gbc.gridy = 33;
            firstPanel.add(mapLinks, gbc);
            mapLinks.addActionListener(new ActionListener() {
            tabbedPane.add("NEH", firstPanel);
            //NEH Tabbed Pane
            tabbedPane.add("EHDD", secondPanel);
            add(tabbedPane);
            tabbedPane.addChangeListener(new ChangeListener() {
        public static void main(String[] args) throws SQLException,
                                                      ParserConfigurationException,
                                                      SAXException, IOException,
                                                      XPathExpressionException {
            SOS sos = new SOS();
            sos.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            sos.setTitle("SOS");
            sos.setSize(760, 680);
            sos.setVisible(true);
            sos.toFront();
            sos.setMinimumSize(new Dimension(760, 680));
    Thanks,
    MSR.

    I never use GridBagLayout.
    I suggest that you change to combinations of BorderLayout, GridLayout (without "Bag"!) and GroupLayout.
    bye
    TPD

  • How to have automatic resizing of container when JInternalFrame resizes?

    Is there a good way for the automatic resizing of its container when a JInternalFrame is resized?
    The intent is to have the JTree below, automatically resize. for example,
    if you type newlines into the JTextArea contained in JInternalFrames.
    (Tried adding the JInternalFrames to a JDesktopPane, but it did not display them. I wonder if it is inefficient to have a JDesktopPane for each tree node).
    Is there any way to know if a JInternalFrame is resizing? Perhaps then one can reload the tree as:
    treeModel.reload()thanks,
    Anil
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.util.EventObject;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextArea;
    import javax.swing.JToggleButton;
    import javax.swing.JTree;
    import javax.swing.UnsupportedLookAndFeelException;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellEditor;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeSelectionModel;
    public class TreeFrames extends JPanel {
           AnilTreeCellRenderer3 atcr;
           AnilTreeCellEditor4 atce;
           DefaultTreeModel treeModel;
           JTree tree;
         public TreeFrames() {
                super(new BorderLayout());
                   treeModel = new DefaultTreeModel(null);
                   tree = new JTree(treeModel);
                  tree.setEditable(true);
                   tree.getSelectionModel().setSelectionMode(
                             TreeSelectionModel.SINGLE_TREE_SELECTION);
                   tree.setShowsRootHandles(true);
                  tree.setCellRenderer(atcr = new AnilTreeCellRenderer3());
                  tree.setCellEditor(atce = new AnilTreeCellEditor4(tree, atcr));
                   JScrollPane scrollPane = new JScrollPane(tree);
                   add(scrollPane,BorderLayout.CENTER);
         public void setRootNode(DefaultMutableTreeNode node) {
              treeModel.setRoot(node);
              treeModel.reload();
           public static void main(String[] args) throws ClassNotFoundException,
           InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException{
                TreeFrames tb = new TreeFrames();
                tb.setPreferredSize(new Dimension(800,600));
                  JFrame frame = new JFrame("Tree Windows UI Failed");
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  frame.setContentPane(tb);
                  frame.setSize(800, 600);
                  frame.pack();
                  frame.setVisible(true);
                  tb.populate();
         private void populate() {
              TextAreaNode3 r = new TextAreaNode3(this);
              setRootNode(r);
              r.gNode.addFrame();
              r.gNode.addFrame();
              TextAreaNode3 a = new TextAreaNode3(this);
              a.gNode.addFrame();
              treeModel.insertNodeInto(a, r, r.getChildCount());
              treeModel.reload();
    class AnilTreeCellRenderer3 extends DefaultTreeCellRenderer{
         TreeFrames panel;
    DefaultMutableTreeNode currentNode;
      public AnilTreeCellRenderer3() {
         super();
    public Component getTreeCellRendererComponent
       (JTree tree, Object value, boolean selected, boolean expanded,
       boolean leaf, int row, boolean hasFocus){
         TextAreaNode3 currentNode = (TextAreaNode3)value;
         NodeGUI4 gNode = (NodeGUI4) currentNode.gNode;
        return gNode.hBox;
    class AnilTreeCellEditor4 extends DefaultTreeCellEditor{
      DefaultTreeCellRenderer rend;
      public AnilTreeCellEditor4(JTree tree, DefaultTreeCellRenderer r){
        super(tree, r);
        rend = r;
      public Component getTreeCellEditorComponent(JTree tree, Object value,
       boolean isSelected, boolean expanded, boolean leaf, int row){
        return rend.getTreeCellRendererComponent(tree, value, isSelected, expanded,
         leaf, row, true);
      public boolean isCellEditable(EventObject event){
        return true;
    * this is done to keep gui separate from model - as in MVC.
    * not necessary.
    * @author juwo
    class NodeGUI4 {
         JPanel notes = new JPanel();
         final TreeFrames view;
         Box hBox = Box.createHorizontalBox();
         final JTextArea textArea = new JTextArea( 1, 5 );
         NodeGUI4( TreeFrames view_ ) {
              this.view = view_;
              hBox.add( textArea );
              textArea.setBorder( BorderFactory.createMatteBorder( 0, 0, 1, 0, Color.GREEN )
              hBox.add(notes);
              hBox.setBorder( BorderFactory.createMatteBorder( 5, 5, 5, 5, Color.CYAN ) );
         void addFrame() {
            MyInternalFrame frame = new MyInternalFrame();
            frame.add(new JTextArea(1,5));
            frame.setVisible(true); //necessary as of 1.3
            notes.add(frame);
            try {
                frame.setSelected(true);
            } catch (java.beans.PropertyVetoException e) {}
    class TextAreaNode3 extends DefaultMutableTreeNode {
         NodeGUI4 gNode;
         TextAreaNode3(TreeFrames view_t) {
              gNode = new NodeGUI4(view_t);
    class MyInternalFrame extends JInternalFrame {
        static int openFrameCount = 0;
        static final int xOffset = 0, yOffset = 0;
        public MyInternalFrame() {
            super("Document #" + (++openFrameCount),
                  true, //resizable
                  true, //closable
                  true, //maximizable
                  true);//iconifiable
            //...Create the GUI and put it in the window...
            //...Then set the window size or call pack...
            setSize(300,300);
            //Set the window's location.
            setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
            this.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);
    }

    I think this does what you want; it's basically the same technique as we used before.
    It also suffers from an interesting bug: if I type in the text area inside the internal frame, the editor resizes nicely
    with the node below it staying visible; if I type in the text area next to the panel, the editor will resize over the node
    below it. I didn't dig into it further to see the cause.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Insets;
    import java.awt.Rectangle;
    import java.awt.event.ComponentAdapter;
    import java.awt.event.ComponentEvent;
    import java.util.EventObject;
    import javax.swing.BorderFactory;
    import javax.swing.Box;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.UnsupportedLookAndFeelException;
    import javax.swing.event.DocumentEvent;
    import javax.swing.event.DocumentListener;
    import javax.swing.plaf.basic.BasicTreeUI;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellEditor;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreePath;
    import javax.swing.tree.TreeSelectionModel;
    public class TreeFrames extends JPanel {
         AnilTreeCellRenderer3 atcr;
         AnilTreeCellEditor4 atce;
         DefaultTreeModel treeModel;
         JTree tree;
         public TreeFrames() {
              super( new BorderLayout() );
              treeModel = new DefaultTreeModel( null );
              tree = new JTree( treeModel );
              tree.setUI( new TextAreaTreeUI() );
              tree.setEditable( true );
              tree.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
              tree.setShowsRootHandles( true );
              tree.setCellRenderer( atcr = new AnilTreeCellRenderer3() );
              tree.setCellEditor( atce = new AnilTreeCellEditor4( tree, atcr ) );
              JScrollPane scrollPane = new JScrollPane( tree );
              add( scrollPane, BorderLayout.CENTER );
         public void setRootNode( DefaultMutableTreeNode node ) {
              treeModel.setRoot( node );
              treeModel.reload();
         public static void main( String[] args ) throws ClassNotFoundException, InstantiationException,
                   IllegalAccessException, UnsupportedLookAndFeelException {
              TreeFrames tb = new TreeFrames();
              tb.setPreferredSize( new Dimension( 800, 600 ) );
              JFrame frame = new JFrame( "Tree Windows UI Failed" );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.setContentPane( tb );
              frame.setSize( 800, 600 );
              frame.pack();
              frame.setVisible( true );
              tb.populate();
         private void populate() {
              TextAreaNode3 r = new TextAreaNode3( this );
              setRootNode( r );
              r.gNode.addFrame();
              r.gNode.addFrame();
              TextAreaNode3 a = new TextAreaNode3( this );
              a.gNode.addFrame();
              treeModel.insertNodeInto( a, r, r.getChildCount() );
              treeModel.reload();
         private static class AnilTreeCellRenderer3 extends DefaultTreeCellRenderer {
              TreeFrames panel;
              DefaultMutableTreeNode currentNode;
              public AnilTreeCellRenderer3() {
                   super();
              public Component getTreeCellRendererComponent( JTree tree, Object value, boolean selected, boolean expanded,
                        boolean leaf, int row, boolean hasFocus ) {
                   TextAreaNode3 currentNode = (TextAreaNode3) value;
                   NodeGUI4 gNode = (NodeGUI4) currentNode.gNode;
                   return gNode.hBox;
         private static class AnilTreeCellEditor4 extends DefaultTreeCellEditor {
              DefaultTreeCellRenderer rend;
              public AnilTreeCellEditor4( JTree tree, DefaultTreeCellRenderer r ) {
                   super( tree, r );
                   rend = r;
              public Component getTreeCellEditorComponent( JTree tree, Object value, boolean isSelected, boolean expanded,
                        boolean leaf, int row ) {
                   return rend.getTreeCellRendererComponent( tree, value, isSelected, expanded, leaf, row, true );
              public boolean isCellEditable( EventObject event ) {
                   return true;
          * this is done to keep gui separate from model - as in MVC. not necessary.
          * @author juwo
         private static class NodeGUI4 {
              JPanel notes = new JPanel();
              final TreeFrames view;
              Box hBox = Box.createHorizontalBox();
              final JTextArea textArea = new JTextArea( 1, 5 );
              NodeGUI4( TreeFrames view_ ) {
                   this.view = view_;
                   hBox.add( textArea );
                   textArea.setBorder( BorderFactory.createMatteBorder( 0, 0, 1, 0, Color.GREEN ) );
                   hBox.add( notes );
                   hBox.setBorder( BorderFactory.createMatteBorder( 5, 5, 5, 5, Color.CYAN ) );
                   DocumentListener dl = new DocumentListener() {
                        public void insertUpdate( DocumentEvent de ) {
                             resizeEditor();
                        public void removeUpdate( DocumentEvent de ) {
                             resizeEditor();
                        public void changedUpdate( DocumentEvent de ) {
                   textArea.getDocument().addDocumentListener( dl );
              void addFrame() {
                   MyInternalFrame frame = new MyInternalFrame();
                   frame.getContentPane().add( new JTextArea( 1, 5 ) );
                   frame.setVisible( true ); // necessary as of 1.3
                   notes.add( frame );
                   try {
                        frame.setSelected( true );
                   } catch ( java.beans.PropertyVetoException e ) {
                   frame.addComponentListener( new ComponentAdapter() {
                        public void componentResized( ComponentEvent e ) {
                             resizeEditor();
              private void resizeEditor() {
                   TreePath path = view.tree.getEditingPath();
                   if ( path != null ) {
                        Rectangle nodeBounds = ( (BasicTreeUI) view.tree.getUI() ).getPathBounds( view.tree, path );
                        Dimension editorSize = getEditorPreferredSize();
                        hBox.setBounds( nodeBounds.x, nodeBounds.y,
                                  editorSize.width, editorSize.height );
                        hBox.validate();
                        Rectangle visRect = view.tree.getVisibleRect();
                        view.tree.paintImmediately( nodeBounds.x, nodeBounds.y,
                                  visRect.width + visRect.x - nodeBounds.x,
                                  editorSize.height );
                        ( (TextAreaTreeUI) view.tree.getUI() ).resizeTree( path );
              private Dimension getEditorPreferredSize() {
                   Insets insets = hBox.getInsets();
                   Dimension boxSize = hBox.getPreferredSize();
                   Dimension taSize = textArea.getPreferredSize();
                   Dimension nSize = notes.getPreferredSize();
                   int height = taSize.height + nSize.height + insets.top
                             + insets.bottom;
                   int width = taSize.width + nSize.width;
                   if ( width < boxSize.width )
                        width += insets.right + insets.left + 3; // 3 for cursor
                   return new Dimension( width, height );
         private static class TextAreaNode3 extends DefaultMutableTreeNode {
              NodeGUI4 gNode;
              TextAreaNode3( TreeFrames view_t ) {
                   gNode = new NodeGUI4( view_t );
         private static class MyInternalFrame extends JInternalFrame {
              static int openFrameCount = 0;
              static final int xOffset = 0, yOffset = 0;
              public MyInternalFrame() {
                   super( "Document #" + ( ++openFrameCount ), true, // resizable
                             true, // closable
                             true, // maximizable
                             true );// iconifiable
                   // ...Create the GUI and put it in the window...
                   // ...Then set the window size or call pack...
                   setSize( 300, 300 );
                   // Set the window's location.
                   setLocation( xOffset * openFrameCount, yOffset * openFrameCount );
                   this.putClientProperty( "JInternalFrame.isPalette", Boolean.TRUE );
         private class TextAreaTreeUI extends BasicTreeUI {
              public void resizeTree( TreePath path ) {
                  treeState.invalidatePathBounds(path);
                  updateSize();
    }

  • How to resize the components in a JFrame when the JFrame Resizes?

    Hi all,
    i have some problems with my app. I have set the JFrame resizable and that works fine for the JFrame but not for the components in the JFrame.
    So my question is how can i set the components in a JFrame to resize automatically when the JFrame resizes?
    Here are the important things from my code,...if you need more, just let me know, its my first post in a forum .
    Its a JFrame with a JTabbedPane and on the Tabs are Panels with buttons and Tables.
    Thank you in advance!
    public class MainMonitor extends JFrame {
    public MainMonitor() {
              super();
              initialize();
              setVisible(true);
         private void initialize() {
              this.setSize(1145, 785);
              this.setIconImage(Toolkit.getDefaultToolkit().getImage("Images/c.gif"));
              this.setContentPane(getJContentPane());
              this.setTitle("Company Manager");
              this.setResizable(true);
              this.setLocationRelativeTo(null);
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.setOpaque(true);
                   jContentPane.add(getJTabbedPane(), null);
                   jContentPane.add(getJPanel11(), null);
              return jContentPane;
         private JTabbedPane getJTabbedPane() {
              if (jTabbedPane == null) {
                   jTabbedPane = new JTabbedPane();
                   jTabbedPane.setLocation(new Point(6, 69));
                   jTabbedPane.setSize(new Dimension(1120, 684));
                   jTabbedPane.addTab("P", null, getJPanel(), null);
                   jTabbedPane.addTab("K", null, getJPanel1(), null);
                   jTabbedPane.addTab("B", null, getJPanel2(), null);
              return jTabbedPane;
         

    Giasaste wrote:
    Thanks a lot, i didnt knew that the Layout Manager is a must.It's not a must, but it is the way to allow your app to be resized nicely and makes it much easier to maintain and enhance your program. Imagine creating a complex gui then later decide that you want another radiobutton and to remove a jlabel / jtextfield pair. with layout managers a chore becomes easy.

  • Issue with re-sizing JTable Headers, JTabbedPane and JSplit pane

    Ok, hopefully I'll explain this well enough.
    In my Swing application I have a split pane, on the left hand side is a JTable and on the right hand is a JTabbedPane. In the tabs of the JTabbedPane there are other JTables.
    In order to make the rows in the JTable on the left and the JTable(s) on the right line up, the Table Header of all the tables is set to the size of the tallest (deepest?) table header.
    Hopefully so far I'm making sense. Now to get to the issue. One of the tables has a number of columns equal to the value on a NumberSpinner (it represents a number of weeks). When this value is changed the table is modified so that it contains the correct number of columns. As the table is re-drawn the table header goes back to its default size so I call my header-resize method to ensure it lines up.
    The problem is this: if I change the number of weeks when selecting a tab other than the one containing my table then everything is fine, the table header is re-sized and everything lines up. If I change the number of weeks with the tab containing the table selected, the column headers stay at their standard size and nothing lines up.
    To make things more complicated, I also put System.out.println's in as every method called in the process to obtain the size of the table header. And every println returned the same height, the height the table header should be.. So I'm really confused.
    Could anyone shed any light on this?
    Thanks.

    Okay I managed to solve the problem by explicitly revalidating and repainting the table header.
    Not sure why it wasnt doing it properly for that table when all the others where fine.
    Oh well...

  • JTable in JPanel last Column resize clips JTable doesnt repaint JPanel

    I have a JTable in a JPanel, when I drag the last column of the JTableHeader (u can see the column resizing as the text of the Table HeaderColumn moves with the drag) the JTable is outside the JPanel. Only when u click on another component and then click back on the JTableHeader does it repaint.
    I have tried jPanel.revalidate(); in the mouseDragged event of MouseMotionListener on the JTableHeader and all manner or repaints and fireTableStructureChanged. But I dont understand the order of events.
    The last bug to fix!!!
    NB I dont want to use scrollpane as its not necessary and as many tables are synchronized with one table it makes repaints less smooth
    Thanks Paul

    Well, I didn't find an answer but I did find a solution.
    The JPanel is the problem. I use it to help with layout which is not obvious in this example.
    As you can see in the code the JTable is placed in a JScrollPane which is place in a JPanel which is placed in a JTabbedPane.
    If I use Box instead of JPanel the JTable in the JScrollPane in the Box in the TabbedPane in the JFrame resizes correclty.
    So although JPanel is resizable with setSize it does not get resized when it's JFrame gets resized.
    I would still like to know why?
    ////////KBS
    JTabbedPane myTP = new JTabbedPane();
    Box myOne = Box.createHorizontalBox();
    Box myTwo = Box.createHorizontalBox();
    myOne.add(pane);
    myTP.add("One", myOne);
    myTP.add("Two", myTwo);
    ////////KBS

Maybe you are looking for

  • Why doesn't my integrated microphone work?

    I have a Pavillion dv6 and after running through all the troubleshooting steps for the microphone, it does not work (although it shows up as functioning properly).  My webcam does not work either.  I have uninstalled ald reinstalled both with no succ

  • Special Characters in SAP R/3 System

    Hi All, I need some help to handle the below situation. I need some help in XI. Below is the message from SXMB_MONI This is FILE to BAPI UPLOAD Scenario. The bolded characters above have special characters (First letter of the Bolded part). The value

  • MacBook Air 11"

    I'm studying PE, Art, DT, Geography, French, Double Science Award, English and Maths. My laptop (Acer Aspire) is completely ruined, it's so slow and the screen is broken and i have to plug it in to my TV in my room to see the screen. I want to get a

  • Actual work less than planned work

    Projects 2010 If actual work is less than planned work the column remaining work is filled with difference between planning and actual. The actual work do complete the job (=100%). If % is put to 100 after actual work is filled and remaining work is

  • How do I switch on auto bar point snap with position pointer?

    My previous versions of Logic (on PC...Logic 5) used to do this automatically....but on Mac (Logic 8) I can't seem to get the position pointer in the arrange page to automatically snap to a bar point when I mouse click close to a bar point in the bar