Panel within a Panel

Hi,
how can i add a panel within a Panel or to update the second panel within a panel having the same frame.
pls advise.
bunch of thks

I don't know if this is what you're wondering, but this code adds a panel to a panel.
JPanel panel = new JPanel();
JPanel subPanel = new JPanel();
panel.add(subPanel);Josh

Similar Messages

  • Resizing panels inside of panels inside of panels...

    I'm trying to organize a GUI by using a series of panels inside a JFrame. I have added panels within these panels to organize my information since I've never been able to figure out that ghastly GridBagLayout. Anyway, I've hit a wall. It seems that I can't resize an object inside of a panel that's inside of a panel. I use the setPrefferedSize method, but it just doesn't have any effect. This is true for both panels and buttons. Am I right in my assumption that there's a limit to how far into a pile of panels one can use the setPrefferedSize method? I'm using primarily BoxLayouts if that makes any difference. Any help or suggestions or advice would be appreciated.

    I'm afraid the SwingUtilities.updateComponentTreeUI didn't work. When I say I'm a novice, I'm afraid I'm kind of shooting in the dark as to some solutions and problems. Let me try and clarify my problem a little bit with an example. I have JPanels A, B, C, D, E, F, G and JCheckBoxes 1, 2, 3. JPanel A is added to the JFrame. The rest go as follows:
    A.add(B);
    B.add(C);
    C.add(D);
    C.add(E);
    D.add(F);
    D.add(G);
    G.add(1);
    G.add(2);
    G.add(3);
    Every JPanel has used the .setPreferredSize() method to define the size I desire. JPanels A, B, C, D, and E all keep their preferred sizes. However, F and G mock me by resizing according to the sizes of JCheckBoxes 1, 2, and 3. Even though they are coded to take up a certain amount of space (which is well within the limits of JPanel D), they don't. Instead they just go to the default size, which is to allow all components within it to be visible. I have this same problem when I add other components into JPanels D and E, like buttons, other JPanels, etc. I hope this clarified more than it confused.

  • Accordion - Ajax within accordion panel resize issue

    Hi,
    I'm in a little bit of a fix.
    I have an accordion whose panels have ajax enabled regions
    within them.
    The ajax enabled regions have search forms which give a
    search result within the same page (which is basically within the
    panel as well) once a button is clicked.
    My issue is that once I click search, my result set increases
    the size of the page causing the accodion panel to enable a scroll
    bar. Is there some way in which I can have spry resize the panel
    instead of it enabling a scroll bar?
    If I open and close the tab ofcourse, the region is resized
    to cater to the search results as well with no scroll bar.
    Incase this is not possible, is there a way to reopen the
    selected panel on a page refresh event as all the tabs are closed
    when a refresh occurs.
    Thanks!
    When the accordion opens up, it shows

    Hi kundalani,
    If you are using Spry.Utils.updateContent() to load the
    contents of the panel, you can pass in a callback that sets the
    height of the AccordionPanelContent to "auto" after the new content
    has loaded:
    function LoadContent(ele, url)
    ele = Spry.$(ele);
    Spry.Utils.updateContent(ele, url, function() {
    ele.style.height = "auto"; });
    <a href="#" onclick="LoadContent('e1p2',
    '../../data/frag1.html'); return false;">Frag 1</a> |
    <a href="#" onclick="LoadContent('e1p2',
    '../../data/frag2.html'); return false;">Frag
    2</a></p>
    <p> </p>
    <div id="example1" class="Accordion" tabindex="0">
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 1
    </div>
    <div id="e1p1" class="AccordionPanelContent">
    <p>Panel 1</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 2
    </div>
    <div id="e1p2" class="AccordionPanelContent">
    <p>Panel 2</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 3
    </div>
    <div id="e1p3" class="AccordionPanelContent">
    <p>Panel 3</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 4
    </div>
    <div id="e1p4" class="AccordionPanelContent">
    <p>Panel 4</p>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    var example1 = new Spry.Widget.Accordion("example1", {
    useFixedPanelHeights: false });
    </script>
    --== Kin ==--

  • Button interactions within Scroll Panel/Content

    I am creating a portfolio website using Flash Catalyst. On my Portfolio page I have a vertical scroll panel and within that panel I have little thumbnails of my artwork converted to a button component. So when the user click on the thumbnail I want the larger image to appear nearby. I make new states for the larger images within the scrolling content, but whenever I use the scroll thumb it also scroll the larger images that i want it to be in a fixed position. So is there anyway I can lock the larger image while user is able to scroll through the thumbnails. If not possible, is there anyway i can duplicate the events on the timeline from one page/state to another similar one?
    If there is a better way to accomplish this please let me know too, I am all ears. If you need clarification on my issue, I will try my best to explain it through texts.

    Hi,
    Here's a quick wireframe to illustrate the thumbnail separate from the detail image.   The large images could be in their own custom component or in different states in the main timeline (per this example).
    The scroll bar needs be edited to look nicer.
    Hope this helps.
    Tanya

  • Scrolling within Accordion panel

    Hi, I have an Accordion panel with a lot of text within one of the panels. The panel is pinned and the text flows below the browser baseline when opened on smaller screen sizes. Would be great to have a mini scroll bar included as an option in future to get around this problem. Thanks!

    Hi kundalani,
    If you are using Spry.Utils.updateContent() to load the
    contents of the panel, you can pass in a callback that sets the
    height of the AccordionPanelContent to "auto" after the new content
    has loaded:
    function LoadContent(ele, url)
    ele = Spry.$(ele);
    Spry.Utils.updateContent(ele, url, function() {
    ele.style.height = "auto"; });
    <a href="#" onclick="LoadContent('e1p2',
    '../../data/frag1.html'); return false;">Frag 1</a> |
    <a href="#" onclick="LoadContent('e1p2',
    '../../data/frag2.html'); return false;">Frag
    2</a></p>
    <p> </p>
    <div id="example1" class="Accordion" tabindex="0">
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 1
    </div>
    <div id="e1p1" class="AccordionPanelContent">
    <p>Panel 1</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 2
    </div>
    <div id="e1p2" class="AccordionPanelContent">
    <p>Panel 2</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 3
    </div>
    <div id="e1p3" class="AccordionPanelContent">
    <p>Panel 3</p>
    </div>
    </div>
    <div class="AccordionPanel">
    <div class="AccordionPanelTab">Panel 4
    </div>
    <div id="e1p4" class="AccordionPanelContent">
    <p>Panel 4</p>
    </div>
    </div>
    </div>
    <script type="text/javascript">
    var example1 = new Spry.Widget.Accordion("example1", {
    useFixedPanelHeights: false });
    </script>
    --== Kin ==--

  • Collapsible Panel within another Collapsible Panel HEIGHT ISSUE

    Having an issue with the height of a collapsible panel that has another collapsible panel within it not adjusting. I am using Dreamweaver CS5.
    When I try the fix of changing line 431 in .js  (where you change "px" to "auto" where it says this.content.style.height = this.toHeight + "auto";) it does not work in IE7 or Firefox. If I change  the height inferences in the .js on lines 392, 431, and 439--it  worksperfect in Firefox, however it throws an error in IE7. Anyone have a  clue???
    Here is my page: http://www.l-3choosewisely.com/dev/
    username: owl
    password: l3ae2011
    Help would be greatly appreciated. PLEASE PLEASE PLEASE help me!

    For right now I have "semi-fixed" the issue, by adding a min-height to my second collapsible panel set, but really am NOT HAPPY
    with it... please help me, it has to be something with the auto-height... I know I am looking right at it and just not seeing it.

  • Updating a panel within a container

    I am attempting to update a panel within a container. I have tried to search the forum but couldn't find a solution. The codes are listed below. What am I doing wrong?
    package test;
    import java.awt.*;
    import java.awt.Graphics;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.plaf.FontUIResource;
    import javax.swing.plaf.ColorUIResource;
    class Template1 extends JFrame {     
         private static final Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
         private JLabel numLockKey, capsLockKey, mode;
         protected Container pane;
         protected JPanel buttonPanel, basePanel;
         public Template1() {
              super("Soybean Candles -- Authorized Personnel Only");                
            buildLayout();       
              setSize(screenSize.width, screenSize.height);                    
                 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 setResizable(false);             
              show();                              
         private void buildLayout() {
              pane = getContentPane();
              pane.setLayout(new BorderLayout());          
              basePanel = new JPanel(new BorderLayout());
              basePanel.add(new JLabel(new ImageIcon("C:/GUI/Images/plogo.jpg")), BorderLayout.CENTER);
                pane.add(panel_1(), BorderLayout.NORTH);
                pane.add(basePanel, BorderLayout.CENTER);            
         private JPanel panel_1() {
              buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10));          
              buttonPanel.setBackground(Color.decode("#526dad"));
              JButton buttons[] = new JButton[3];
              buttonPanel.add(createButton(buttons[0], "TIME CLOCK", new TestAction()));
              buttonPanel.add(createButton(buttons[1], "LOGIN", new LoginAction()));
              buttonPanel.add(createButton(buttons[2], "EXIT", new TestAction()));
              return buttonPanel;
         private JButton createButton(JButton btn, String displayTxt, AbstractAction action) {
              Dimension dim = new Dimension(100, 40);
              btn = new JButton(action);
              btn.setText(displayTxt);          
              btn.setPreferredSize(dim);
              btn.setMaximumSize(dim);
              btn.setMinimumSize(dim);
              btn.setBorder(BorderFactory.createLineBorder(Color.white, 2));
              btn.setBackground(Color.decode("#3e4b84"));
              btn.setForeground(Color.white);          
              btn.setFocusPainted(false);
              btn.setActionCommand(displayTxt);
              return btn;          
         private JPanel panel_2() {          
              basePanel = new JPanel(new BorderLayout());
              basePanel.add(new JLabel(new ImageIcon("C:/GUI/Images/plogo.jpg")), BorderLayout.CENTER);
              return basePanel;
         public static void main(String args[]) {
              UIManager.put("Label.font", new FontUIResource(new Font("Arial", Font.PLAIN, 12)));
              UIManager.put("Button.font", new FontUIResource(new Font("Arial", Font.PLAIN, 12)));
              Template1 tpl = new Template1();
         class TestAction extends AbstractAction {             
                 public void actionPerformed(ActionEvent e) {
                      System.out.println("button pressed");
            class LoginAction extends AbstractAction {
                 public void actionPerformed(ActionEvent e) {
                      basePanel.invalidate();
                    basePanel = new JPanel();
                   basePanel.add(new JLabel("test"));
                   basePanel.repaint();               
    }

    You're creating a new panel every time an action is performed. That panel is never going to be visible unless you add it to the frame.
    Either remove the old panel and add the new panel or add the label to the panel you already have without creating a new one. Then call validate on the whole frame, and it should work.

  • Disable all the components of a panel ( panels within the main panel )

    Hi guys!
    I have a problem!
    i have to disable all the components of a panel. please note that i am also having panels within the main panel. please tell me how to do that!!!
    its urgent!!

    Hi guys!
    I have a problem!Wouldn't have figured that one out by myself ...
    its urgent!!No, it's not.
    You know, a panel is most often a subclass of Container, so all you need to do is recursively disable all child components. The methods getComponents and getComponent are very helpful when trying to access child components. Code likeif ( comp instanceof Container )
      // do soemthing
    }will help in determining whether a child component is yet another Container.

  • How to load an Applet on a panel, within another Applet

    Hi,
    I want to know if and how it is possible to load an applet/application on a Panel within another Applet/Apllication.
    Who can help me?
    tnx

    You want to use an applet inside an other applet?
    Applet extends Panel
    you can take the source of the second applet, and instead of extending Applet extends Panel, and call the init method from the first applet.
    Hope this help

  • No icons within Control Panel, Administrative Tools Folder

    I believe this problems relates to a terminal services policy package as
    the problem only exists on our Citrix Metafrme servers. Regardless of who
    logs onto the console of any of our 6 Citrix W2K servers, within Control
    Panel, Administrative tools, there are either 0 icons or 2 .NET framework
    icons only. I can however access all icons in Administrative Tools by
    going through Start, Programs, Administrative tools.
    Can anyone assure me that this is a policy issue and where the settings
    are as I'm ****ed if I can find them?
    Thanks
    Lenny

    Lennyd,
    It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at http://support.novell.com in both the "free product support" and "paid product support" drop down boxes.
    - You could also try posting your message again. Make sure it is posted in the correct newsgroup. (http://support.novell.com/forums)
    If this is a reply to a duplicate posting, please ignore and accept our apologies and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Resizing & Positioning Children within a Panel

    I'm trying to insert an element into a Panel that has a vertical layout, and create a transition that smoothly inserts the new item in between 2 existing items in the base state of the application.  My goal is for the bottom text field to remain anchored to the bottom of the panel as the panel resizes, instead of jumping to its new position, so that the middle text input can then gracefully fade in.
    Am I just missing something in how I'm defining the transitions, or will the effects not yet account for the positioning of items from layout?  Attached is the MXML app and the compiled SWF.
    Thanks.

    This will get you what you want. There's a tricky interaction between adding the new element and the vertical layout. The third item won't make room for the second one unless the second one is actually added to the parent. But adding it will immediately make it visible, which is not what you want. So I tweaked the effect to add it but make it non-visible (alpha==0), then Resize the second element itself (the panel will resize automatically), *then* fade in the second element.
                <s:Sequence>
                    <s:SetAction target="{secondTxt}" property="alpha" value="0"/>
                    <s:Resize target="{secondTxt}" heightFrom="0"/>
                    <s:Parallel>
                        <s:Move target="{thirdTxt}" />
                        <s:Fade target="{secondTxt}" alphaTo="1"/>
                    </s:Parallel>
                </s:Sequence>
    Chet.

  • Html panel - inside html panel?

    hi everyone
    i have a page with a main content div which is an html panel theat will load different content
    one of the (fragment) pages it loads has xml data etc on it.
    i now need on this dynamic page a little html  in a div too, but that means an html panel within an html panel!
    i declared var infolpanel; on the main page, and the maincontent htmlpanel div has evalscripts set true
    on the dynamic fragment page, the xml datasets are working etc, but i need another html panel
    infopanel = new Spry.Widget.HTMLPanel("info");
    infopanel.loadContent('products/'+ product + '/info.html');}};
    now when i load the page, none of the xml data populates either, instead showing {dataset::variable} instead :-s
    removing the above javascript again fixes it.
    so, is there any (other?) way for this fragmented page to load a smaller fragment into the div?
    thanks
    delboy

    How do I open another collapsible panel, on a different page
    through a link? I have tried many different ways, including trying
    to use SpryURLUtils.js and am not having any luck? I really wanted
    to jump to a different pages' collapsible panel, open it, and then
    populate the SpryHTMLPanel, located inside that targeted
    collapsible panel. My collapsible panels and HTML panels all work
    fine on the target page, when just interacting on the page itself,
    with mouseclicks. Inside the collapsible panels I have unordered
    list of links, that populate HTMLpanels, with the appropriate HTML
    fragments. My problems lies in crosslinking from other webpages to
    the exact collapsible panel, and then populating the exact HTML
    fragment, just as if I had clicked on the link in the list, if I
    had been on the target page in the first place.
    <a href="../OA_qi_docreq.html?panel=0#cp1">
    <a href="../OA_qi_docreq.html#cp1">
    <a href="../OA_qi_docreq.html#cp1.open();">

  • Collapsible panel in morphing panel

    Hi,
    Hope this isnt too complicated:
    I searched and found that if you have a nested collapsible panel within another, you can fix the downward expandible problem by changing line 431 of SpryCollapsiblePanel.js from:
    this.content.style.height = this.toHeight + "px";
    to:
    this.content.style.height = "auto";
    I'm having a similar problem only I have a collapsible panel nested into one of the tabs of a spry morphing panel. When clicked the collapsible panel expands downwards under the border of the morphing panel, so the content cannot be seen. The above fix did not work.
    Here is a link to a morphing panel sample:
    http://labs.adobe.com/technologies/spry/ui/samples/MorphPanelsSample.html
    My collapsible panel is nested within the second tab at the bottom.
    Anyone have a fix for this?
    I wrapped the collapsible panel in a div with an overflow of hidden and that didnt work, I also played around with the SpryMorphPanels.js but couldnt come up with anything.

    100+ views, any takes on this?
    Gramps your magic is needed.
    Maybe the markup would help:
    <div id="ex1" class="liveSample">
                 <ul id="ex1-tabs" class="SimpleTabs" style=" font-size:16px;">
    <li><a href="#ex1-s1" >Card</a></li>
    <li><a href="#ex1-s2">Biography</a></li>
    <li><a href="#ex1-s3">References</a></li>
    <li><a href="#ex1-s4">Articles</a></li>
    </ul>
                     <div class="content">
            <div id="ex1-s1" class="section">
                <div class="content">
                                   content1              
                               </div>
                                                    </div>
                <div id="ex1-s2" class="section">
                <div class="content" align="left" style="font-family: Lekton;">
    <h2>Biography</h2>
    <div id="CollapsiblePanel1" class="CollapsiblePanel">
    <div class="CollapsiblePanelTab" tabindex="0">Tab</div>
    <div class="CollapsiblePanelContent">
    <p>Content</p>
    <p>info</p>
    <p>info</p>
                          </div>
                    </div>
    </div>
    </div>
                <div id="ex1-s3" class="section">
                <div class="content" align="left">
    <h2>References by this Author</h2>
    </div>
                                                    </div>
    </div>
    </div>

  • Check a checkbox in a jtable in a panel from another panel

    I have a panel-> Panel A
    where I have some conditions and on that condition I want to check a checkbox in a jtable in another panel ->PanelB
    So Panel B has a jtable with one column as checkbox,I want to check/uncheck this checkbox based on some conditions in some other panel A
    I have no idea how to do this.Please help.
    Thanks

    885522 wrote:
    How will the change be reflected dynamically if the value changes in some other panel.By code that you write. If you want component X to change based on some changes to component Y, then first you set up a listener which will notify you when changes to component Y take place. In that listener you put code which makes the appropriate changes to component X, based on what happened to component Y.

  • Spry Accordions, Tabbed Panels, and Collapsible Panels: changing colors

    I wanted to alert everyone to a great new Community article published by our very own David Powers. The article details the various best practices and methods for changing the colors of Accordion, Tabbed Panels, and Collapsible Panels widgets, including tab backgrounds, borders, and so on.
    Here's the article:
    http://kb2.adobe.com/community/publishing/504/cpsid_50437.html
    Customization questions are pretty frequent in both the Spry and Dreamweaver forums. This new styling guide is sure to answer lots of peoples' questions.
    Furthermore, the appearance of such an article is a great example of how Community content can interact and live symbiotically with Adobe Help. We've linked directly to David's piece from our own customization pages for the Spry Accordion, Tabbed Panels, and Collapsible Panels widgets:
    Customize the Accordion widget
    Customize the Tabbed Panels widget
    Customize the Collapsible Panels widget
    Thanks a lot to David for hammering out this article.
    If you're interested in publishing Community articles of your own, you can download the Community Publishing AIR application and get right to work!

    The borders you see, are called outline, its a accesiblity feature of the browsers,
    Actually called 'focus' lines  :-)
    Here's an article about the Bluefocus lines seen in Safari.
    http://www.brunobergher.com/blog/2009/01/19/safaris-blue-focus-lines/
    Without creating a Spry widget myself right now to test, but I'm sure thata there is a 'focus' rule in the css...
    trying the
    {outline:none;}
    on that rule.

Maybe you are looking for